:root {
    --brand: #0ea5e9;
    --brand-dark: #0284c7;
    --bg: #030712;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-dim: #94a3b8;
}

[data-theme="light"] {
    --bg: #f8fafc;
    --glass: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-dim: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, hsla(210, 100%, 16%, 0.5) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(225, 100%, 16%, 0.5) 0, transparent 50%);
    background-attachment: fixed;
    transition: background-color 0.3s, color 0.3s;
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(at 0% 0%, hsla(210, 100%, 90%, 0.8) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(225, 100%, 90%, 0.8) 0, transparent 50%);
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: background-color 0.3s;
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.8);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}

.logo span {
    color: var(--brand);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--brand);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.page-header p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Content Sections */
.section {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.section h2 {
    margin-bottom: 20px;
    color: var(--brand);
}

.section p {
    margin-bottom: 15px;
    color: var(--text-dim);
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--glass-border);
    margin-top: 100px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
}

/* Search UI Components (reused) */
.search-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 20px;
    display: flex;
    gap: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
    flex: 1;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
    color: var(--text-main);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(14, 165, 233, 0.1);
}

.suggestion-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
}

input, textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
}

[data-theme="light"] .search-container {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

[data-theme="light"] #suggestionsBox {
    background: #ffffff !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1) !important;
}

[data-theme="light"] .suggestion-item {
    color: #0f172a !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .suggestion-item:hover {
    background: rgba(14, 165, 233, 0.05) !important;
}

[data-theme="light"] .card {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

[data-theme="light"] .copy-btn {
    background: rgba(0,0,0,0.05);
    color: #0f172a;
}

.btn-primary {
    background: linear-gradient(to right, var(--brand-dark), var(--brand));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

/* ---- Homepage Sections (GrabOn Style) ---- */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.trending-section, .categories-section {
    margin-bottom: 40px;
}

/* Trending Brands */
.trending-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: none; /* Hide scrollbar */
}
.trending-grid::-webkit-scrollbar { display: none; }

.trending-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 80px;
    transition: 0.3s;
}
.trending-card:hover { transform: translateY(-3px); }
.trending-card img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    border: 2px solid var(--glass-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 5px;
}
.trending-card span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
}
[data-theme="light"] .trending-card img { border-color: rgba(0,0,0,0.05); }

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}
.category-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
}
.category-card:hover {
    background: rgba(14, 165, 233, 0.05);
    border-color: var(--brand);
    transform: translateY(-3px);
}
.category-card span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
[data-theme="light"] .category-card { background: rgba(255,255,255,0.6); }

/* Filters bar desktop centering */
.filters {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body { padding: 0; }

    /* Nav - compact on mobile */
    nav {
        padding: 14px 18px;
        border-radius: 0;
    }
    .nav-links {
        gap: 16px;
    }
    .nav-links a {
        font-size: 0.82rem;
    }

    /* Container */
    .container {
        margin: 30px auto;
        padding: 0 16px;
    }

    /* Header */
    .page-header {
        margin-bottom: 28px;
        text-align: left;
    }
    .page-header h1 {
        font-size: 2rem;
        letter-spacing: -0.5px;
    }
    .page-header p {
        font-size: 0.92rem;
    }

    /* Search bar - side by side, properly sized */
    .search-container {
        padding: 6px 6px 6px 14px;
        border-radius: 16px;
        margin-bottom: 16px;
        gap: 8px;
    }
    .search-container input {
        font-size: 0.95rem;
        padding: 10px 0;
    }
    .btn-primary {
        padding: 11px 20px;
        font-size: 0.9rem;
        border-radius: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Recent searches */
    .recent-searches {
        margin-bottom: 16px;
    }

    /* Filters - full width, smooth horizontal scroll */
    .filters {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 0 16px 14px 16px;
        margin: 0 0 24px 0;
        scrollbar-width: none;
        justify-content: flex-start;
    }
    .filters::-webkit-scrollbar { display: none; }

    .filter-btn {
        flex: 0 0 auto;
        padding: 7px 16px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    /* Results grid - 1 column */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Cards - vertical layout, clean */
    .card {
        flex-direction: column;
        padding: 18px;
        border-radius: 18px;
        gap: 0;
        animation: cardIn 0.3s ease forwards;
    }
    .card-header {
        margin-bottom: 10px;
    }
    .card-header h3 {
        font-size: 1rem !important;
    }
    .snippet {
        font-size: 0.85rem;
        margin-bottom: 16px;
        height: auto;
        max-height: 3.5em;
    }
    .card-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 14px;
        gap: 10px;
    }
    .code {
        font-size: 0.85rem;
        padding: 5px 12px;
    }
    .copy-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    /* Summary section */
    #summarySection h2 {
        font-size: 1.2rem !important;
    }
}

/* Very small phones (< 400px) */
@media (max-width: 400px) {
    nav { padding: 12px 14px; }
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 0.78rem; }
    .page-header h1 { font-size: 1.7rem; }
    .search-container { padding: 5px 5px 5px 12px; }
    .btn-primary { padding: 10px 14px; font-size: 0.85rem; }
}

