: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;
    --secondary-bg: #f1f5f9;
    --secondary-hover: #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; padding-top: 60px; }

.sidebar { width: 280px; background: var(--bg-color); border-right: 1px solid var(--border-color); padding: 1.5rem 0; overflow-y: auto; position: fixed; top: 60px; left: 0; height: calc(100vh - 60px); z-index: 90; transition: transform 0.3s; }



.sidebar-logo {
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.lang-flags { display: flex; gap: 8px; align-items: center; margin: 0; }

.lang-flag {
    width: 24px;
    height: 18px;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0.4;
    transition: all 0.2s;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.lang-flag:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.lang-flag.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--primary-color);
    transform: scale(1.1);
}

.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;
}


/* Accordion */
.nav-group {
    border-bottom: 1px solid var(--border-color);
}
.nav-group:last-child {
    border-bottom: none;
}
.nav-category {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
    font-weight: 600;
    font-size: 1.05rem;
}
.nav-category:hover {
    background: var(--secondary-bg);
}
.nav-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}
.nav-group.open .nav-arrow {
    transform: rotate(180deg);
}
.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.nav-group.open .nav-group-content {
    max-height: 500px;
}
.nav-item {
    padding: 0.7rem 1.5rem 0.7rem 2.5rem;
}

/* old nav-category */
.nav-category-old {
    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;
    justify-content: space-between;
    gap: 0.75rem;
}

.nav-text {
    flex: 1;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    font-family: sans-serif;
}

.nav-item:hover .info-icon {
    opacity: 1;
}

.info-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.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 {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
 flex: 1; padding: 2rem; margin-left: 280px; max-width: 1200px; margin-right: auto; }



.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: var(--bg-color);
}

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: var(--card-bg);
}

textarea {
    resize: vertical;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* ====== AURORA THEME (CHAR.COM.UA STYLE) ====== */
/* Restored animated background */
.aurora-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, rgba(99,102,241,0) 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, rgba(236,72,153,0) 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(56,189,248,0.3) 0%, rgba(56,189,248,0) 70%);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}











.aurora-noise {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.04;
    mix-blend-mode: overlay;
}

@keyframes auroraFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15vw, 15vh) scale(1.2); }
    100% { transform: translate(-10vw, 20vh) scale(0.8); }
}





















.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: var(--secondary-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.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;
}

/* ====== TOPBAR ====== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-sizing: border-box;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-svg {
    height: 30px;
    width: auto;
    display: block;
}

#mobileMenuBtn {
    display: none;
}

/* ====== FOOTER ====== */
.site-footer {
    margin-top: auto;

    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
}
.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

.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 Menu Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsiveness */

@media (max-width: 850px) {
    .topbar { padding: 0 1rem; }
    #mobileMenuBtn { display: block; }
    .topbar-logo { display: none; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 60px);
        margin-left: 0; padding: 1rem; width: 100%; box-sizing: border-box; 
    }
    
    /* Mobile Language Flags Scroll */
    .topbar-right { gap: 10px; }
    .lang-flags {
        max-width: calc(100vw - 200px); /* Adjust based on hamburger + theme btn */
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    .lang-flags::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .lang-flag {
        flex-shrink: 0;
    }
}

.site-footer {
    margin-top: auto;

    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}



/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #121212;
    --sidebar-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #9e9e9e;
    --border-color: #333333;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-bg: #2d2d2d;
    --secondary-hover: #3d3d3d;
    --g-title: #8ab4f8;
    --g-title-visited: #c58af9;
    --g-url: #bdc1c6;
    --g-desc: #bdc1c6;
}

/* Midnight Theme */
[data-theme="midnight"] {
    --bg-color: #0b1120;
    --sidebar-bg: #111827;
    --card-bg: #111827;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #1f2937;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-bg: #1f2937;
    --secondary-hover: #374151;
    --g-title: #8ab4f8;
    --g-title-visited: #c58af9;
    --g-url: #bdc1c6;
    --g-desc: #bdc1c6;
}


/* ====== MODAL ====== */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-close {
    color: var(--text-muted);
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-color);
    text-decoration: none;
}

/* Backdrop Highlighting Styles */
.hl-container {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.hl-backdrop, .hl-textarea {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    text-indent: 0 !important;
    font-weight: 400 !important;
    padding: 0.75rem 1rem !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    tab-size: 4 !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

.hl-textarea {
    position: relative;
    z-index: 2;
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
    display: block;
    width: 100%;
    resize: vertical;
}

.hl-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border: 1px solid transparent !important;
    color: transparent !important;
    pointer-events: none;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100%;
    width: 100%;
    background-color: var(--card-bg) !important;
}

.hl-backdrop mark {
    background-color: rgba(255, 235, 59, 0.6);
    color: transparent;
    border-radius: 3px;
    padding: 0;
    margin: 0;
}

/* Clickable Forms in Stats Table */
.row-clickable {
    transition: color 0.2s;
}
tr:hover .row-clickable {
    color: var(--primary-color);
}
.form-clickable {
    cursor: pointer;
    border-bottom: 1px dashed var(--text-muted);
    transition: all 0.2s;
    margin: 0 2px;
}
.form-clickable:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
