:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f1f5f9;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Google SERP Colors */
    --g-title: #1a0dab;
    --g-title-visited: #681da8;
    --g-url: #202124;
    --g-desc: #4d5156;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    border: none;
    padding: 0;
}

.sidebar-nav {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.nav-category {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background-color: var(--bg-color);
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 1200px;
}

.mobile-header {
    display: none;
    background: var(--sidebar-bg);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    margin: -2rem -2rem 2rem -2rem;
}

.mobile-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    border: none;
    padding: 0;
}

.tool-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Utilities */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 950px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    background-color: #fafafa;
}

textarea:focus, input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

textarea {
    resize: vertical;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* ====== AURORA THEME (CHAR.COM.UA STYLE) ====== */
[data-theme="aurora"] {
    --bg-main: #0f1016;
    --bg-card: rgba(25, 28, 35, 0.5);
    --text-main: #ffffff;
    --text-muted: #a0a5b1;
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #5bbc6e;
    --primary-hover: #4ea85f;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --secondary-hover: rgba(255, 255, 255, 0.1);
}

.aurora-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-main);
    opacity: 0;
    transition: opacity 0.5s ease;
}

[data-theme="aurora"] .aurora-bg { opacity: 1; }

[data-theme="aurora"] .aurora-bg::before,
[data-theme="aurora"] .aurora-bg::after {
    content: '';
    position: absolute;
    width: 60vw; height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    animation: auroraFloat 15s infinite alternate ease-in-out;
}

[data-theme="aurora"] .aurora-bg::before {
    background: rgba(91, 188, 110, 0.18); /* #5bbc6e */
    top: -10vw; left: -10vw;
}

[data-theme="aurora"] .aurora-bg::after {
    background: rgba(228, 85, 134, 0.18); /* #e45586 */
    bottom: -10vw; right: -10vw;
    animation-delay: -7s;
}

@keyframes auroraFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10vw, 10vh) scale(1.1); }
    100% { transform: translate(-5vw, 15vh) scale(0.9); }
}

[data-theme="aurora"] .card,
[data-theme="aurora"] .sidebar,
[data-theme="aurora"] .mobile-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="aurora"] .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="aurora"] .btn-primary {
    background: linear-gradient(90deg, #5bbc6e, #e45586);
    border: none;
    color: white;
}

[data-theme="aurora"] .btn-primary:hover {
    background: linear-gradient(90deg, #4ea85f, #cf4875);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(228, 85, 134, 0.3);
}

[data-theme="aurora"] input,
[data-theme="aurora"] textarea,
[data-theme="aurora"] select {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="aurora"] input:focus,
[data-theme="aurora"] textarea:focus,
[data-theme="aurora"] select:focus {
    border-color: #e45586;
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="aurora"] .data-table th,
[data-theme="aurora"] .data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="aurora"] .data-table th {
    background-color: rgba(255, 255, 255, 0.05);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.radio-label input[type="radio"] {
    accent-color: var(--primary-color);
    width: 1rem;
    height: 1rem;
}

.label-with-action, .label-with-counter {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.label-with-action label, .label-with-counter label {
    margin-bottom: 0;
}

.counter {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background-color: var(--primary-color);
    color: white;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Progress bars */
.progress-bar-container {
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--success-color);
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* FAQ specifics */
.faq-item {
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
    background: #fafafa;
}
.faq-remove {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--danger-color);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Analyzer specifics */
.stat-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}
.table-container {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

/* Google SERP Styling */
.preview-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.preview-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.google-preview {
    font-family: arial, sans-serif;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dfe1e5;
}
.g-url-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.g-favicon {
    width: 16px;
    height: 16px;
    background-color: #e2e8f0;
    border-radius: 50%;
    display: inline-block;
}
.g-url {
    font-size: 14px;
    color: var(--g-url);
    line-height: 1.3;
}
.g-title {
    font-size: 20px;
    color: var(--g-title);
    line-height: 1.3;
    margin-bottom: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.g-title:hover {
    text-decoration: underline;
}
.g-desc {
    font-size: 14px;
    color: var(--g-desc);
    line-height: 1.58;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 850px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .mobile-header {
        display: flex;
        margin: -1rem -1rem 1.5rem -1rem;
    }
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .controls {
        gap: 0.75rem;
        flex-direction: column;
    }
    .label-with-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .btn-sm {
        width: 100%;
        margin-top: 0.25rem;
    }
}
