/* Dark Theme - FantasyXXX Dashboard - Fully Responsive */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #0b0b12;
    color: #f2f2f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ============================================ */
/* HEADER STYLES */
/* ============================================ */

.header {
    position: sticky;
    top: 0;
    background: #141423;
    border-bottom: 1px solid #262646;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    gap: 12px;
}

/* Mobile Menu Toggle (Hamburger) - Hidden on desktop */
.mobile-menu-toggle {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    color: #f2f2f7;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    background: #f2f2f7;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #ff2fb3;
    font-size: 18px;
}

.brand .logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #8a2be2, #ff2fb3);
    flex-shrink: 0;
}

.brand-name {
    white-space: nowrap;
}

/* Search */
.search {
    flex: 1;
    max-width: 520px;
    margin: 0 16px;
}

.search input {
    width: 100%;
    height: 36px;
    border: 1px solid #262646;
    border-radius: 8px;
    padding: 0 12px;
    background: #0f0f1b;
    color: #f2f2f7;
    outline: none;
    transition: border-color 0.2s;
    font-size: 14px;
}

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

/* Mobile Search Toggle - Hidden on desktop */
.mobile-search-toggle,
.mobile-sidebar-toggle {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #f2f2f7;
    transition: opacity 0.2s;
}

.mobile-search-toggle:hover,
.mobile-sidebar-toggle:hover {
    opacity: 0.7;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 11, 18, 0.95);
    z-index: 2000;
    padding: 20px;
}

.mobile-search-overlay.active {
    display: flex;
    align-items: flex-start;
    padding-top: 80px;
}

.mobile-search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.mobile-search-input {
    width: 100%;
    height: 48px;
    border: 2px solid #ff2fb3;
    border-radius: 12px;
    padding: 0 50px 0 20px;
    background: #141423;
    color: #f2f2f7;
    font-size: 16px;
    outline: none;
}

.mobile-search-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #f2f2f7;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #8a2be2, #ff2fb3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
    font-size: 14px;
}

.profile:hover {
    opacity: 0.8;
}

/* ============================================ */
/* LAYOUT GRID */
/* ============================================ */

.layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 16px;
    max-width: 1400px;
    margin: 16px auto;
    padding: 0 16px;
    flex: 1;
    width: 100%;
}

/* ============================================ */
/* LEFT SIDEBAR NAVIGATION */
/* ============================================ */

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.rightbar {
    display: flex;
    flex-direction: column;
    border: 1px solid #262646;
    border-radius: 12px;
    background: #141423;
    padding: 12px;
    height: auto;
    max-height: calc(100vh - 96px);
    overflow: hidden;
    position: fixed;
    right: 16px;
    top: 80px;
    width: 300px;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    border: 1px solid #262646;
    border-radius: 12px;
    background: #141423;
    padding: 12px;
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.mobile-nav-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #262646;
    margin: -12px -12px 12px -12px;
}

.mobile-nav-title {
    font-weight: 800;
    font-size: 18px;
    color: #ff2fb3;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: #f2f2f7;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #f2f2f7;
    transition: all 0.2s;
    margin-bottom: 4px;
    min-height: 44px; /* Touch-friendly */
}

.nav-item:hover {
    background: #1f1f33;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255,47,179,0.2), rgba(138,43,226,0.2));
    border-left: 3px solid #ff2fb3;
}

.nav .icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-label {
    font-size: 15px;
    font-weight: 500;
}

/* ============================================ */
/* MAIN CONTENT AREA */
/* ============================================ */

.main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 400px;
}

.card {
    border: 1px solid #262646;
    border-radius: 12px;
    background: #141423;
    padding: 16px;
    box-shadow: 0 0 20px rgba(255, 47, 179, 0.1);
}

.card-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: #ff2fb3;
}

/* ============================================ */
/* RIGHT SIDEBAR */
/* ============================================ */

.mobile-rightbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-rightbar-overlay.active {
    display: block;
    opacity: 1;
}

.rightbar {
    border: 1px solid #262646;
    border-radius: 12px;
    background: #141423;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.mobile-sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #262646;
    margin: -12px -12px 12px -12px;
}

.mobile-sidebar-title {
    font-weight: 800;
    font-size: 18px;
    color: #ff2fb3;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    color: #f2f2f7;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-section {
    padding-bottom: 12px;
    border-bottom: 1px solid #262646;
}

.sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 12px;
    color: #ff2fb3;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    min-height: 44px; /* Touch-friendly */
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: #262646;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.item-title {
    font-weight: 600;
    font-size: 13px;
}

.muted {
    color: #a1a1b5;
    font-size: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-value {
    font-weight: 700;
    font-size: 18px;
    color: #ff2fb3;
}

/* ============================================ */
/* BUTTONS */
/* ============================================ */

.btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #262646;
    background: linear-gradient(90deg, #ff2fb3, #8a2be2);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 14px;
    text-align: center;
    min-height: 44px; /* Touch-friendly */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 36px;
}

.btn-secondary {
    background: #262646;
    color: #f2f2f7;
}

/* ============================================ */
/* FOOTER */
/* ============================================ */

.footer {
    max-width: 1400px;
    margin: 24px auto 0;
    padding: 24px 16px;
    border-top: 1px solid #262646;
    width: 100%;
}

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

.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #a1a1b5;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    padding: 8px 0; /* Touch-friendly */
}

.footer-links a:hover {
    color: #ff2fb3;
}

.footer-copy {
    color: #a1a1b5;
    font-size: 12px;
}

/* ============================================ */
/* RESPONSIVE BREAKPOINTS */
/* ============================================ */

/* 1280x1024 and similar narrow desktop resolutions */
@media (max-width: 1320px) and (min-width: 1025px) {
    .layout {
        grid-template-columns: 200px 1fr 280px;
        gap: 12px;
        max-width: 100%;
    }
    
    .search {
        max-width: 350px;
    }
    
    /* Enable horizontal scroll if content overflows */
    body {
        overflow-x: auto;
    }
    
    .main {
        min-width: 500px;
    }
}

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 200px 1fr;
        gap: 12px;
    }
    
    /* Right sidebar becomes slide-out panel */
    .rightbar {
        display: flex;
        position: fixed;
        top: 0;
        right: -320px;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 999;
        border-radius: 0;
        margin: 0;
        max-height: 100vh;
        transition: right 0.3s ease;
        border-right: none;
    }
    
    .rightbar.active {
        right: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-sidebar-header {
        display: flex;
    }

    /* Keep right sidebar accessible when it becomes off-canvas */
    .mobile-sidebar-toggle {
        display: block !important;
    }
    
    .search {
        max-width: 400px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 0 12px;
        height: 56px;
    }
    
    .brand-name {
        font-size: 16px;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block !important;
    }
    
    /* Hide desktop search, show mobile search toggle */
    .search {
        display: none !important;
    }
    
    .mobile-search-toggle,
    .mobile-sidebar-toggle {
        display: block !important;
    }
    
    /* Single column layout */
    .layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 12px;
        margin: 12px auto;
    }
    
    /* Left sidebar - slide in from left on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 999;
        border-radius: 0;
        margin: 0;
        max-height: 100vh;
        transition: left 0.3s ease;
        border-left: none;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-nav-header {
        display: flex;
    }
    
    /* Right sidebar - slide in from right on mobile */
    .rightbar {
        display: flex;
        position: fixed;
        top: 0;
        right: -320px;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 999;
        border-radius: 0;
        margin: 0;
        max-height: 100vh;
        transition: right 0.3s ease;
        border-right: none;
    }
    
    .rightbar.active {
        right: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-sidebar-header {
        display: flex;
    }
    
    /* Cards - more padding on mobile */
    .card {
        padding: 14px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 20px 12px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .footer-links {
        gap: 12px;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .header {
        padding: 0 8px;
    }
    
    .brand .logo {
        width: 24px;
        height: 24px;
    }
    
    .brand-name {
        font-size: 14px;
    }
    
    .profile {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .layout {
        padding: 0 8px;
        margin: 8px auto;
        gap: 8px;
    }
    
    .card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================ */
/* UTILITIES */
/* ============================================ */

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0b12;
}

::-webkit-scrollbar-thumb {
    background: #262646;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff2fb3;
}

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid #ff2fb3;
    outline-offset: 2px;
}
