* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Mode Only */
    --primary-blue: #007AFF;
    --primary-purple: #5856D6;
    --bg-primary: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --bg-glass: rgba(28, 28, 30, 0.85);
    --bg-glass-sidebar: rgba(44, 44, 46, 0.8);
    --text-primary: #F5F5F7;
    --text-secondary: #98989D;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --card-gradient: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
}

.search-input {
    background: #3A3A3C;
}

.tabs {
    background: #3A3A3C;
}

.tab:hover {
    background: #48484A;
}

.card {
    border-color: rgba(255, 255, 255, 0.06);
}

.card:hover {
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 122, 255, 0.1);
}

.card::before {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.06), transparent 60%);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hero-search-input {
    caret-color: #007AFF;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 0;
}

.search-engine-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.search-engine-btn:hover {
    background: var(--bg-primary);
}

.search-engine-dropdown {
    position: absolute;
    top: 52px;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: none;
    min-width: 180px;
    overflow: hidden;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-engine-dropdown.show {
    display: block;
}

.search-engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.search-engine-option:hover {
    background: rgba(0, 122, 255, 0.08);
}

.search-engine-option.active {
    background: rgba(0, 122, 255, 0.12);
    color: var(--primary-blue);
    font-weight: 600;
}

.search-engine-option .engine-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 44px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-input:focus~.search-hint {
    opacity: 1;
}

/* Theme Toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: rotate(30deg);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 72px;
    bottom: 0;
    width: 240px;
    background: var(--bg-glass-sidebar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-content {
    padding: 24px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(0, 122, 255, 0.08);
    color: var(--primary-blue);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 72px;
    padding: 0 0 0 0;
    max-width: 1400px;
}

/* Hero Search Section */
.hero-search {
    position: relative;
    width: 100%;
    min-height: 320px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 48px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 30%, #2a2040 50%, #1a283c 70%, #0f1923 100%);
    z-index: 0;
}

.hero-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 10%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 25%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 8%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 85% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 45%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 15%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 55%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 40%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 78% 50%, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.hero-mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background:
        linear-gradient(135deg, transparent 33%, #d4d8de 33%, #c8cdd4 40%, transparent 40%),
        linear-gradient(225deg, transparent 33%, #bbc2cc 33%, #adb5c0 40%, transparent 40%),
        linear-gradient(145deg, transparent 38%, #e8eaee 38%, #dde0e5 45%, transparent 45%),
        linear-gradient(215deg, transparent 42%, #cdd2da 42%, #c0c6d0 48%, transparent 48%);
    opacity: 0.3;
}

.hero-mountains::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(15, 25, 35, 0.9), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-search-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
}

.hero-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.hero-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
}

.hero-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.hero-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.hero-search-bar {
    display: flex;
    width: 100%;
    border-radius: 0 8px 8px 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-search-input {
    flex: 1;
    height: 50px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: background 0.2s ease;
}

.hero-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.hero-search-input:focus {
    background: rgba(255, 255, 255, 0.18);
}

.hero-search-btn {
    width: 56px;
    height: 50px;
    background: var(--primary-blue);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.hero-search-btn:hover {
    background: #0066d9;
}

.hero-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.hero-tag {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.hero-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

/* Sections padding within main content */
.content-section {
    padding-left: 32px;
    padding-right: 32px;
    margin-bottom: 64px;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.03), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 122, 255, 0.15);
    border-color: var(--primary-blue);
}

.card:hover::before {
    opacity: 1;
}

.card:active {
    transform: translateY(-2px) scale(1);
}

.card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-gradient);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.08);
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info p {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .hero-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .hero-content {
        padding: 40px 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .content-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-search-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hero-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .hero-content {
        padding: 32px 16px;
    }

    .hero-search {
        min-height: 280px;
    }

    .hero-quick-links {
        gap: 6px;
    }

    .hero-tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .header-content {
        padding: 0 16px;
    }

    .search-container {
        max-width: 300px;
    }

    .section-title {
        font-size: 24px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .search-hint {
        display: none;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(0, 122, 255, 0.2);
    color: var(--text-primary);
}