:root {
    /* Light Mode (Default) */
    --primary: #FF0000;
    --primary-dark: #CC0000;
    --chart-blue: #065FD4;
    --chart-blue-light: rgba(6, 95, 212, 0.15);
    --accent: #FFD700;
    --bg-dark: #F9F9F9;
    --bg-card: #FFFFFF;
    --text-main: #0F0F0F;
    --text-dim: #606060;
    --glass: #FFFFFF;
    --glass-border: #E5E5E5;
    --glow-color: rgba(255, 0, 0, 0.05);
    --table-header: #F2F2F2;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --header-height: 80px;
    --primary-light: rgba(255, 0, 0, 0.15);
    --primary-rgb: 255, 0, 0;
}

[data-theme="dark"] {
    --bg-dark: #0A0A0B;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-main: #FFFFFF;
    --text-dim: #A0A0A0;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(255, 0, 0, 0.15);
    --table-header: rgba(255, 255, 255, 0.02);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --primary-light: rgba(255, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding-top: var(--header-height);
    transition: background-color 0.3s, color 0.3s;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: 0.3s;
    color: var(--text-main);
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    transform: rotate(20deg);
    background: var(--glass-border);
}

/* Glow Background */
.glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: var(--glow-color);
    top: -100px;
    right: -100px;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 215, 0, 0.05);
    bottom: -50px;
    left: -50px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.6;
}

.gradient-text {
    background: linear-gradient(90deg, #FF0000, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
nav:not(.breadcrumb) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gather menu content for larger screens */
@media (min-width: 1400px) {
    nav:not(.breadcrumb) {
        padding: 0 calc((100% - 1300px) / 2);
    }
}

/* ===== Ad Banner area ===== */
.ad-banner-top {
    width: 100%;
    max-width: 1100px;
    margin: 1.5rem auto 0 auto;
    text-align: center;
    min-height: 90px;
    background: linear-gradient(135deg, var(--bg-card), var(--glass-border));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.ad-banner-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.ad-placeholder-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .ad-banner-top {
        min-height: 50px;
        margin-top: 1rem;
        margin-left: 5%;
        margin-right: 5%;
        width: 90%;
    }
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.logo img {
    height: 100%;
    width: auto;
    max-height: calc(var(--header-height) - 10px);
    display: block;
    object-fit: contain;
}



.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.3s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Hide hamburger by default — only visible on mobile */
.mobile-menu-btn {
    display: none;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2005;
}

/* Language Selector */
.lang-selector {
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--glass-border);
    transition: 0.3s;
}

.lang-selector:hover {
    background: var(--glass);
}

.lang-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 140px;
    padding: 10px 0;
    box-shadow: var(--card-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.lang-selector:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.lang-item:hover {
    background: var(--glass-border);
    color: var(--primary);
}

/* Remove redundant nav-links styles */

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 5% 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* Search Bar */
.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    border-radius: 50px;
    width: 100%;
    max-width: 800px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
    transform: translateY(-2px);
    background: var(--bg-card);
}

/* Tool Tabs and Optimizer */
.tool-wrapper {
    width: 100%;
    margin-top: 2.5rem;
    animation: fadeInUp 0.5s ease-out;
    text-align: center;
}

.tool-tabs {
    display: inline-flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    background: var(--glass);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.tool-tab {
    background: transparent;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-tab:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tool-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Optimizer Box */
.ai-optimizer-box {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.opt-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.opt-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.opt-field label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.api-help-link {
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.api-help-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.opt-field input,
.opt-field textarea,
.opt-field select {
    background: var(--bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    appearance: none;
    -webkit-appearance: none;
}

[data-theme="dark"] .opt-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

[data-theme="light"] .opt-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.opt-field select {
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.opt-field textarea {
    min-height: 80px;
    resize: vertical;
}

.opt-field input:focus,
.opt-field textarea:focus,
.opt-field select:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.opt-field input.error {
    border-color: #ff4d4d !important;
    background-color: rgba(255, 77, 77, 0.05) !important;
}

.error-msg {
    color: #ff4d4d;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: -4px;
    padding-left: 4px;
    display: none;
}

.opt-field input.error+.error-msg {
    display: block;
}

.opt-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.opt-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary ion-icon {
    font-size: 1.3rem;
}

.optimizer-results {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-top: 1px dashed var(--glass-border);
    padding-top: 25px;
}

.opt-result-item {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    text-align: left;
}

[data-theme="dark"] .opt-result-item {
    background: rgba(255, 255, 255, 0.03);
}

.opt-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.opt-result-header h4 {
    margin: 0;
    color: var(--primary);
    font-size: 1rem;
}

.opt-output {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
}

.btn-copy-opt {
    background: var(--glass-border);
    border: none;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-copy-opt:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .opt-row {
        grid-template-columns: 1fr;
    }

    .opt-actions {
        flex-direction: column;
    }
}

.search-box ion-icon {
    font-size: 1.5rem;
    color: var(--text-dim);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    flex-grow: 1;
    min-width: 150px;
}

.country-selector {
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-left: 1px solid var(--glass-border);
    outline: none;
}

.country-selector option {
    background: var(--bg-card);
    color: var(--text-main);
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 0.5rem;
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Results Section */
.results-container {
    padding: 4rem 5%;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--glass-border);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.stat-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.text-green {
    color: #4CAF50;
}

/* Table */
.keyword-list-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--table-header);
    text-align: center;
    padding: 1.2rem;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

th.sortable {
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

th.sortable:hover {
    background: var(--glass-border);
    color: var(--text-main);
}

th:first-child,
td:first-child {
    text-align: left;
}

td {
    padding: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.data-row td {
    border-bottom: none;
    padding-bottom: 0.5rem;
    padding-top: 1.5rem;
}

.chart-row td {
    padding-top: 0;
    padding-bottom: 2rem;
}

/* Grouping hover effect using :has() for bi-directional highlighting */
.data-row:hover td,
.data-row:hover+.chart-row .trend-card-inner {
    background: rgba(var(--primary-rgb), 0.04) !important;
}

/* Highlight data-row when chart-row is hovered */
tr:has(+ .chart-row:hover) td,
.chart-row:hover .trend-card-inner {
    background: rgba(var(--primary-rgb), 0.04) !important;
}

.trend-card-inner {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-row:hover .trend-card-inner,
.data-row:hover+.chart-row .trend-card-inner {
    border-color: var(--chart-blue);
    box-shadow: 0 8px 25px rgba(6, 95, 212, 0.12);
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1000;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.6);
}

.relevance-bar {
    width: 100px;
    height: 6px;
    background: var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}

.relevance-fill {
    height: 100%;
    background: var(--primary);
}

/* ===== Search History ===== */
.history-container {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.history-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.history-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-tag {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-main);
}

.history-tag:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Trend Bars & Volume Labels */
.trend-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 55px;
    padding-top: 5px;
    position: relative;
}

.trend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.trend-bar {
    width: 100%;
    min-width: 6px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    opacity: 0.3;
    transition: 0.3s;
}

.trend-bar.active {
    opacity: 1;
}

.trend-volume {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.difficulty-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.diff-easy {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.diff-medium {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
}

.diff-hard {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

/* ===== Results Legend/Note ===== */
.results-legend {
    display: none;
    /* Shown via JS when searching */
    align-items: center;
    gap: 8px;
    margin: 20px auto 12px auto;
    padding: 10px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    width: fit-content;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.results-legend ion-icon {
    font-size: 1.1rem;
    color: #4285f4;
    /* Using a professional blue for the calendar icon */
}

/* ===== AI Source Badges ===== */
.source-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.5;
}

.source-google {
    background: rgba(66, 133, 244, 0.1);
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.25);
}

.source-ai {
    background: rgba(16, 163, 127, 0.1);
    color: #10a37f;
    border: 1px solid rgba(16, 163, 127, 0.25);
}

.source-mistral {
    background: rgba(138, 43, 226, 0.1);
    color: #8a2be2;
    border: 1px solid rgba(138, 43, 226, 0.25);
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 4rem 5%;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-card ion-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-dim);
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ===== Progress Bar ===== */
.progress-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 0;
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-align: left;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 8px;
}

#progressPercent {
    font-weight: 600;
    color: var(--primary);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    width: 0%;
    transition: width 0.25s ease;
}

.progress-time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ===== Export Buttons ===== */
.btn-excel {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.btn-excel:hover {
    background: rgba(76, 175, 80, 0.1) !important;
}

.btn-pdf {
    color: #FF7043;
    border-color: rgba(255, 112, 67, 0.3);
}

.btn-pdf:hover {
    background: rgba(255, 112, 67, 0.1) !important;
}

.btn-small {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

/* ===== Pulse Card (Live Counter) ===== */
.pulse-card {
    border-color: rgba(255, 0, 0, 0.2);
    position: relative;
}

.pulse-card::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #FF0000;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.4);
    }
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* ===== Toast Notification ===== */
#toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Skeleton Loading ===== */
.skeleton-row td {
    padding: 1.2rem;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.3s;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Content Section */
.content-section {
    padding: 6rem 5%;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-section h1 {
    font-size: 3rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(90deg, #FF0000, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-section h2 {
    font-size: 2.2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.content-section h3 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content-section p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.content-section ul {
    list-style: none;
    margin-bottom: 2rem;
}

.content-section li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.content-section li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}



/* Footer Links */
.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-top: 1.5rem;
}

.results-table {
    width: 100%;
    min-width: 800px;
    /* Force scroll on small screens */
    border-collapse: collapse;
}

/* Responsive Layout Overrides */
@media (max-width: 1200px) {
    nav:not(.breadcrumb) {
        padding: 0 4%;
    }

    .nav-links {
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 850px) {

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        font-size: 1.8rem;
        cursor: pointer;
        z-index: 2005;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 30px;
        gap: 20px;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 2004;
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.nav-active {
        right: 0 !important;
    }

    .nav-links a {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--glass-border);
        font-size: 1.1rem;
        text-align: left;
    }

    .hero {
        padding: 6rem 5% 3rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .search-box {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }

    .search-box button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .results-header {
        flex-direction: column;
        gap: 1.2rem;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .logo span {
        display: none;
    }

    .nav-actions {
        gap: 0.6rem;
    }

    .lang-selector span {
        display: none;
    }

    .hero {
        padding: 5rem 5% 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- LIVE USAGE & STATUS STYLES --- */
.live-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 0, 0, 0.05);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid var(--glass-border);
    white-space: nowrap;
}

[data-theme="dark"] .live-activity {
    background: rgba(255, 0, 0, 0.15);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 10px #4CAF50;
    animation: live-pulse-green 2s infinite;
}

@keyframes live-pulse-green {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.95);
        opacity: 1;
    }
}

.magic-usage-card {
    background: linear-gradient(135deg, #FF0000, #FFD700) !important;
    background-size: 200% 200% !important;
    animation: gradient-shift 5s ease infinite !important;
    color: white !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.magic-usage-card .stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600 !important;
}

.magic-usage-card .stat-value {
    color: white !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1.8rem !important;
}

@media (max-width: 768px) {
    .live-activity {
        display: flex;
        /* Keep it visible in the tool section */
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

/* --- HERO ENHANCEMENTS --- */
.hero-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feat-badge {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.feat-badge ion-icon {
    font-size: 1.1rem;
    color: var(--primary);
}

.feat-badge.highlight {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.feat-badge:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
    border-color: var(--primary);
}

.hero-seo-text {
    font-size: 1rem;
    color: var(--text-dim);
    max-width: 650px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.hero-seo-text strong {
    color: var(--text-main);
}

@media (max-width: 600px) {
    .feat-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .hero-seo-text {
        font-size: 0.9rem;
    }
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    transition: 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px);
    background: var(--primary-dark);
}

/* Language Dropdown Active State */
.lang-selector.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Nav Active State */
@media (max-width: 900px) {
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}