/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    color: #ffffff;
    margin-right: 2px;
}

.logo-prime {
    color: #e50914;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #e50914;
}

/* Category Dropdown Styles */
.category-dropdown {
    position: relative;
}

.category-trigger {
    position: relative;
}

.category-trigger:after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.category-trigger[aria-expanded="true"]:after {
    transform: rotate(180deg);
}

/* Desktop Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    width: 800px;
    max-height: 500px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    background-color: #222;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #2a2a2a;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: left;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: #999;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #ffffff;
    background-color: #2a2a2a;
}

.tab-button.active {
    color: #e50914;
    background-color: #1a1a1a;
}

.tab-button.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e50914;
}

/* Category Content */
.category-content {
    position: relative;
    min-height: 300px;
}

.category-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 20px;
}

.category-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    position: relative;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 450px;
    overflow-y: auto;
}

.category-item {
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 8px 10px;
    text-align: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.category-item:hover {
    background-color: #e50914;
    border-color: #e50914;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

/* Mobile Category List */
.mobile-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.mobile-category-item {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.mobile-category-item:hover {
    background-color: #e50914;
    border-color: #e50914;
}

/* Accordion Styles */
.accordion-item {
    border-bottom: 1px solid #333;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #2a2a2a;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: left;
}

.accordion-icon {
    font-size: 20px;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #1a1a1a;
}

.accordion-content.active {
    max-height: 80vh;
    overflow-y: auto;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.drawer-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.drawer-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.drawer-content {
    padding: 20px;
}

/* Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-btn,
.notification-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.search-btn:hover,
.notification-btn:hover {
    background-color: #333;
    color: #e50914;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: #e50914;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 3px;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
        height: 56px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background-color: #1a1a1a;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 0 20px;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1001;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #333;
    }

    .nav-link {
        padding: 20px 24px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        text-align: left;
        border: none;
        background: none;
    }

    .nav-link:hover {
        background-color: #2a2a2a;
    }

    .category-trigger::after {
        content: '›';
        border: none;
        font-size: 18px;
        margin-left: auto;
        transform: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-actions .user-name {
        display: none;
    }

    .dropdown-menu {
        display: none;
    }

    /* Enhanced Mobile Drawer */
    .mobile-drawer {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: #1a1a1a;
        z-index: 1002;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
    }

    .mobile-drawer.active {
        right: 0;
    }

    /* Force mobile drawer to show on mobile */
    .mobile-drawer {
        display: block !important;
    }

    .drawer-header {
        position: sticky;
        top: 0;
        background-color: #1a1a1a;
        border-bottom: 1px solid #333;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        z-index: 10;
    }

    .drawer-header h2 {
        font-size: 20px;
        font-weight: 600;
        flex: 1;
    }

    .drawer-close {
        background: none;
        border: none;
        color: #ffffff;
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .drawer-close:hover {
        background-color: #333;
    }

    /* Mobile Category Search */
    .mobile-search {
        padding: 16px 20px;
        border-bottom: 1px solid #333;
    }

    .mobile-search input {
        width: 100%;
        background-color: #2a2a2a;
        border: 1px solid #444;
        border-radius: 8px;
        padding: 12px 16px;
        color: #ffffff;
        font-size: 16px;
        outline: none;
    }

    .mobile-search input:focus {
        border-color: #e50914;
    }

    /* Enhanced Accordion */
    .accordion-item {
        border-bottom: 1px solid #333;
    }

    .accordion-header {
        width: 100%;
        background: none;
        border: none;
        color: #ffffff;
        padding: 24px 20px;
        text-align: left;
        font-size: 18px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
    }

    .accordion-header:hover {
        background-color: #2a2a2a;
    }

    .accordion-header:active {
        background-color: #333;
        transform: scale(0.98);
    }

    .accordion-title {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .accordion-emoji {
        font-size: 20px;
    }

    .accordion-icon {
        font-size: 24px;
        font-weight: 300;
        transition: transform 0.3s ease;
        color: #e50914;
    }

    .drawer-back {
        background: none;
        border: none;
        color: #ffffff;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .drawer-back:hover {
        background-color: #333;
    }

    .accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .accordion-content.active {
        max-height: 2000px;
        padding-bottom: 20px;
    }

    .mobile-category-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 0 20px;
    }

    .mobile-category-item {
        background-color: #2a2a2a;
        border: 1px solid #444;
        border-radius: 8px;
        padding: 16px 12px;
        text-align: center;
        color: #ffffff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.3s ease;
        cursor: pointer;
        display: block;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-category-item:hover {
        background-color: #e50914;
        border-color: #e50914;
        transform: translateY(-2px);
    }

    .mobile-category-item:active {
        transform: scale(0.95);
    }

    /* Mobile Navigation Overlay */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
        height: 52px;
    }

    .logo {
        font-size: 16px;
    }

    .nav-actions {
        gap: 8px;
    }

    .mobile-drawer {
        width: 100%;
    }

    .drawer-content {
        padding: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .mobile-category-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
        padding: 0 12px;
    }

    .mobile-category-item {
        padding: 8px 6px;
        font-size: 11px;
        min-height: 36px;
        line-height: 1.2;
    }

    .accordion-header {
        padding: 14px 16px;
        font-size: 15px;
    }

    .drawer-header {
        padding: 16px;
    }

    .nav-menu {
        width: 90%;
        padding: 70px 0 20px;
    }

    .nav-link {
        padding: 18px 20px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .nav-container {
        padding: 0 10px;
    }

    .mobile-category-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 0 12px;
    }

    .mobile-category-item {
        padding: 12px 8px;
        font-size: 11px;
        min-height: 40px;
    }

    .accordion-header {
        padding: 18px 12px;
        font-size: 15px;
    }

    .drawer-header {
        padding: 12px;
    }

    .nav-menu {
        width: 95%;
    }
}

/* Custom Scrollbar */
.category-grid::-webkit-scrollbar,
.mobile-drawer::-webkit-scrollbar {
    width: 6px;
}

.category-grid::-webkit-scrollbar-track,
.mobile-drawer::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 3px;
}

.category-grid::-webkit-scrollbar-thumb,
.mobile-drawer::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.category-grid::-webkit-scrollbar-thumb:hover,
.mobile-drawer::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Focus States for Accessibility */
.nav-link:focus,
.tab-button:focus,
.category-item:focus,
.accordion-header:focus {
    outline: 2px solid #e50914;
    outline-offset: 2px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Loading State */
.category-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.category-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
