:root {
    --bg-primary: #f8fafc;
    --bg-white: #fff;
    --bg-section: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #8B5CF6;
    --accent-dark: #7C3AED;
    --accent-light: #f3e8ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --star-filled: #f59e0b;
    --star-empty: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px
}

html.dark-mode {
    --bg-primary: #0f172a;
    --bg-white: #1e293b;
    --bg-section: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #B07AF7;
    --accent-dark: #A855F7;
    --accent-light: #2e1065;
    --success: #34d399;
    --success-light: #064e3b;
    --warning: #fbbf24;
    --border: #334155;
    --border-dark: #475569;
    --star-empty: #475569;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3)
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) var(--bg-section)
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px
}

::-webkit-scrollbar-track {
    background: var(--bg-section)
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 6px;
    border: 2px solid var(--bg-section)
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border)
}
}

a {
    color: var(--accent);
    text-decoration: none
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline
}

header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border)
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center
}

.logo:hover {
    text-decoration: none;
    opacity: .9
}

.logo-full {
    height: 130px;
    width: auto
}

.logo-mobile {
    height: 40px;
    width: auto;
    display: none
}

@media(max-width:600px) {
    .logo-full {
        display: none
    }

    .logo-mobile {
        display: block
    }
}

html.dark-mode .logo-full,
html.dark-mode .logo-mobile {
    filter: brightness(1.6)
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .5rem
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all .15s
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-section);
    box-shadow: 0 0 0 1.5px var(--accent);
    text-decoration: none
}

.nav-links .nav-cta {
    background: linear-gradient(135deg, #A855F7 0, #4338CA 100%);
    color: white
}

.nav-links .nav-cta:hover {
    color: white;
    background: linear-gradient(135deg, #9333EA 0, #3730A3 100%);
    box-shadow: none
}

.profile-dropdown {
    position: relative
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background .15s
}

.profile-toggle:hover {
    background: var(--bg-section)
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0, var(--accent-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: .875rem;
    position: relative
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2)
}

.menu-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform .2s
}

.profile-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg)
}

#profile-menu {
    position: absolute;
    top: 56px;
    right: 1.5rem;
    width: 240px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200
}

#profile-menu.active {
    display: block
}

.profile-menu-header {
    padding: .875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem
}

.profile-info {
    flex: 1;
    min-width: 0
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-section);
    border: 1px solid var(--border);
    transition: .3s;
    border-radius: 24px
}

.theme-switch .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--bg-white);
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2)
}

.theme-switch input:checked+.slider {
    background-color: var(--accent);
    border-color: var(--accent)
}

.theme-switch input:checked+.slider::before {
    transform: translateX(20px)
}

.theme-switch .slider svg {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity .2s
}

.theme-switch .slider .sun-icon {
    right: 5px;
    color: var(--warning);
    opacity: 1
}

.theme-switch .slider .moon-icon {
    left: 5px;
    color: white;
    opacity: 0
}

.theme-switch input:checked+.slider .sun-icon {
    opacity: 0
}

.theme-switch input:checked+.slider .moon-icon {
    opacity: 1
}

.profile-name {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-primary)
}

.profile-email {
    display: block;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .125rem;
    overflow: hidden;
    text-overflow: ellipsis
}

.profile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: .25rem 0
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .875rem;
    transition: all .1s
}

.profile-menu-item:hover {
    background: var(--bg-section);
    color: var(--text-primary);
    text-decoration: none
}

.profile-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0
}

.profile-menu-logout {
    color: #dc2626
}

.profile-menu-logout:hover {
    background: #fef2f2;
    color: #dc2626
}

.header-search {
    flex: 1;
    max-width: 480px;
    margin: 0 2rem
}

.header-search form {
    display: flex;
    position: relative
}

.header-search input {
    width: 100%;
    padding: .625rem 1rem .625rem 2.5rem;
    font-size: .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-section);
    transition: all .15s
}

.header-search input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px var(--accent-light)
}

.header-search .search-icon {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted)
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 200
}

.search-suggestions.active {
    display: block
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: background .1s;
    text-decoration: none;
    color: inherit
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: var(--bg-section);
    text-decoration: none
}

.suggestion-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.suggestion-icon svg {
    width: 16px;
    height: 16px;
    color: var(--accent)
}

.suggestion-content {
    flex: 1;
    min-width: 0
}

.suggestion-title {
    font-weight: 500;
    font-size: .9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.suggestion-meta {
    font-size: .75rem;
    color: var(--text-muted)
}

.suggestion-badge {
    flex-shrink: 0;
    padding: .15rem .4rem;
    background: var(--success-light);
    color: var(--success);
    font-size: .65rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase
}

.suggestions-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem
}

.suggestions-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem
}

main {
    max-width: 1280px;
    margin: 0 auto 3rem;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 64px - 80px)
}

footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .025em
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent-dark)
}

.badge-success {
    background: var(--success-light);
    color: var(--success)
}

.badge-muted {
    background: var(--bg-section);
    color: var(--text-secondary)
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--border)
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary)
}

.section-count {
    font-size: .875rem;
    color: var(--text-muted);
    font-weight: 400
}

.show-all-link {
    font-size: .85rem;
    font-weight: 500
}

.back-to-top {
    font-size: .8rem;
    color: var(--accent);
    text-align: right;
    margin-top: 1rem;
    text-decoration: none;
    transition: all .15s
}

.back-to-top:hover {
    color: var(--accent-dark);
    text-decoration: underline
}

footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 32px 20px 24px;
    margin-top: auto
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    grid-column: 2
}

.footer-brand a {
    display: block;
    line-height: 0
}

.footer-logo {
    height: 80px;
    width: auto
}

html.dark-mode .footer-logo {
    filter: brightness(1.6)
}

.footer-tagline {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0
}

.footer-social {
    display: flex;
    gap: 12px
}

.footer-social a {
    color: var(--text-muted);
    transition: color .15s
}

.footer-social a:hover {
    color: var(--accent);
    text-decoration: none
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 3;
    justify-self: end
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: .8rem;
    margin: 0
}

@media(max-width:600px) {
    .footer-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center
    }

    .footer-social {
        justify-content: center;
        grid-column: auto;
        order: 3
    }

    .footer-brand {
        align-items: center;
        grid-column: auto;
        text-align: center;
        order: 1
    }

    .footer-nav {
        grid-column: auto;
        justify-self: auto;
        order: 2
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center
    }
}

.affiliate-disclosure {
    font-size: .75rem;
    opacity: .8
}

.affiliate-disclosure a {
    color: var(--text-secondary);
    text-decoration: none
}

.affiliate-disclosure a:hover {
    color: var(--accent);
    text-decoration: underline
}

.affiliate-disclosure-inline {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .5rem
}

.affiliate-disclosure-inline a {
    color: var(--text-secondary)
}

.affiliate-disclosure-inline a:hover {
    color: var(--accent)
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px
}

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

.footer-links a:hover {
    color: var(--accent)
}

.footer-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s;
    margin-left: 8px
}

.footer-theme-toggle:hover {
    background: var(--bg-section);
    color: var(--text-primary);
    border-color: var(--border-dark)
}

.footer-theme-toggle svg {
    width: 16px;
    height: 16px
}

.footer-theme-toggle .sun-icon {
    display: none
}

.footer-theme-toggle .moon-icon {
    display: block
}

html.dark-mode .footer-theme-toggle .sun-icon {
    display: block
}

html.dark-mode .footer-theme-toggle .moon-icon {
    display: none
}

html.dark-mode .header-search input,
html.dark-mode input[type="text"],
html.dark-mode input[type="search"],
html.dark-mode input[type="email"],
html.dark-mode input[type="password"],
html.dark-mode textarea,
html.dark-mode select {
    color: var(--text-primary)
}

html.dark-mode .header-search input::placeholder {
    color: var(--text-muted)
}

.mobile-actions {
    display: none;
    align-items: center;
    gap: .5rem
}

.mobile-search-btn,
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s
}

.mobile-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0
}

.mobile-profile-btn .profile-avatar {
    width: 32px;
    height: 32px
}

.mobile-search-btn:hover,
.mobile-menu-btn:hover {
    background: var(--bg-section);
    color: var(--text-primary)
}

.mobile-search-btn svg,
.mobile-menu-btn svg {
    width: 22px;
    height: 22px
}

.mobile-menu-btn .close-icon {
    display: none
}

.mobile-menu-btn[aria-expanded="true"] .menu-icon {
    display: none
}

.mobile-menu-btn[aria-expanded="true"] .close-icon {
    display: block
}

@media(max-width:768px) {
    .mobile-actions {
        display: flex
    }

    .header-search {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: .75rem 1rem;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        margin: 0;
        max-width: none;
        z-index: 900
    }

    .header-search.mobile-active {
        display: block
    }

    .header-search input {
        font-size: 16px
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        padding: .5rem 0;
        gap: 0;
        z-index: 950
    }

    .nav-links.active {
        display: flex
    }

    .nav-links a {
        padding: .875rem 1.5rem;
        border-radius: var(--radius-sm);
        font-size: 1rem;
        margin: 0 .5rem
    }

    .nav-links a:hover {
        background: var(--bg-section)
    }

    .nav-links .nav-cta {
        margin: .5rem 1rem;
        border-radius: var(--radius-sm);
        text-align: center
    }

    .nav-links .profile-dropdown {
        display: none
    }

    #profile-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: var(--shadow-lg);
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        z-index: 1000
    }

    .header-inner {
        position: relative
    }

    body.mobile-menu-open {
        overflow: hidden
    }

    main {
        padding: 1.5rem 1rem;
        overflow-x: hidden;
        box-sizing: border-box
    }
}

@media(max-width:600px) {
    .footer-content {
        flex-direction: column;
        text-align: center
    }

    .footer-left,
    .footer-center,
    .footer-right {
        flex: none;
        width: 100%;
        justify-content: center
    }
}