:root {
    --bg-color: #0f111a;
    --panel-bg: rgba(26, 29, 41, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #10b981;
    --error-color: #ef4444;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --glass-blur: blur(16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.orb-1 {
    top: -200px;
    left: -100px;
    background: #6366f1;
}

.orb-2 {
    bottom: -200px;
    right: -100px;
    background: #10b981;
}

/* Base Layout */
.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

/* Main Hub Layout (Index Page) */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.logo i {
    color: var(--primary-color);
}

h1 {
    font-weight: 700;
    color: var(--text-main);
}

h1 span {
    color: var(--primary-color);
    background: linear-gradient(to right, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumbs / Page specific header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.page-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* Navigation inside the app (Replacing old Tab Buttons) */
.tool-nav {
    display: flex;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 6px;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: var(--primary-color);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Tool Grid Layout */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    flex: 1;
    min-height: 600px;
}

@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .app-container {
        padding: 1rem;
    }

    .panel {
        min-height: 500px;
    }
}

.panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-hover);
}

.action-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.editor-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.5rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    width: 100%;
    height: 100%;
}

textarea::placeholder {
    color: var(--text-muted);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Error Toast */
.error-toast {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(239, 68, 68, 0.9);
    border-left: 4px solid #b91c1c;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Success Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--glass-blur);
    backdrop-filter: blur(10px);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.hidden {
    display: none !important;
}

/* Table Preview Style */
.table-preview-container {
    flex: 1;
    padding: 1.5rem;
    overflow: auto;
    background: rgba(0, 0, 0, 0.1);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.preview-table th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-main);
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

.preview-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.preview-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.5;
    gap: 1rem;
    font-size: 1.2rem;
}

.empty-state i {
    font-size: 3rem;
}

/* SEO Content Area */
.seo-content {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.seo-content h2 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.seo-content h3 {
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.seo-content p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.seo-content ul {
    color: var(--text-muted);
    margin-left: 1.5rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Editable Table Styles */
.preview-table td[contenteditable='true']:focus {
    outline: 1px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.preview-table td[contenteditable='true']:hover {
    cursor: text;
    background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
    .logo {
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 1.5rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
        white-space: nowrap;
    }

    .page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }

    .page-title h2 {
        font-size: 1.15rem !important;
        justify-content: center;
        text-align: center;
    }

    .page-desc {
        font-size: 0.85rem;
        text-align: center;
    }

    .tool-nav {
        justify-content: center;
    }
}