/* ==========================================
   HEADER - DARK MODE
   ========================================== */

.ff-site-header {
    background: #0d0d1a;
    padding: 12px 0;
    border-bottom: 2px solid #ff6b00;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.ff-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ===== Left: Brand ===== */
.ff-header-left {
    flex-shrink: 0;
}

.ff-brand {
    color: #ffffff;
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.ff-brand span {
    color: #ff6b00;
}

/* ===== Center: Navigation (Desktop only) ===== */
.ff-header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ff-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 35px;
    align-items: center;
}

.ff-nav-menu li {
    margin: 0;
}

.ff-nav-menu li a {
    color: #9999aa;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.ff-nav-menu li a:hover {
    color: #ffffff;
}

.ff-nav-menu li.current-menu-item a {
    color: #ff6b00;
}

/* ===== Right: Balance + Profile ===== */
.ff-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* ===== Balance ===== */
.ff-header-balance {
    color: #ff6b00;
    font-size: 16px;
    font-weight: 700;
    background: rgba(255, 107, 0, 0.12);
    padding: 5px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 0, 0.15);
    white-space: nowrap;
}

.ff-header-login {
    color: #ff6b00;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.ff-header-login:hover {
    color: #ff8c1a;
}

/* ===== Profile Icon ===== */
.ff-profile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.ff-profile-toggle img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.ff-profile-toggle:hover img {
    border-color: #ff6b00;
    transform: scale(1.05);
}

.ff-profile-icon {
    font-size: 28px;
    color: #b0b0b0;
    transition: all 0.3s ease;
}

.ff-profile-toggle:hover .ff-profile-icon {
    color: #ffffff;
}

.ff-profile-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid #0d0d1a;
    animation: ffPulse 2s infinite;
}

@keyframes ffPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Mobile Toggle ===== */
.ff-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.ff-mobile-toggle span {
    display: block;
    width: 25px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ff-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.ff-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.ff-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Mobile Menu ===== */
.ff-mobile-menu {
    display: none;
    background: #0d0d1a;
    padding: 15px 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ff-mobile-menu.open {
    display: block;
}

.ff-mobile-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.ff-mobile-nav li a {
    color: #9999aa;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ff-mobile-nav li a:hover {
    color: #ffffff;
}

.ff-mobile-balance {
    color: #ff6b00;
    font-size: 16px;
    font-weight: 700;
    padding: 8px 0;
}

/* ==========================================
   PREMIUM LOADING PROGRESS BAR
   ========================================== */

#ff-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a16;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.ff-loader {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.ff-loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.ff-loader-spinner svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ff-loader-spinner circle:last-child {
    stroke: #ff6b00;
    stroke-width: 4;
    stroke-linecap: round;
}

.ff-loader-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.ff-loader-bar {
    width: 250px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.05);
}

.ff-loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b00, #ff8c1a);
    border-radius: 4px;
    transition: width 0.1s ease;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.2);
}

.ff-loader-text {
    font-size: 13px;
    color: #666677;
    font-weight: 400;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: ffLoaderPulse 1.5s ease-in-out infinite;
}

@keyframes ffLoaderPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@media (max-width: 480px) {
    .ff-loader-spinner {
        width: 60px;
        height: 60px;
    }
    .ff-loader-percent {
        font-size: 15px;
    }
    .ff-loader-bar {
        width: 200px;
        height: 3px;
    }
    .ff-loader-text {
        font-size: 11px;
        letter-spacing: 1.5px;
    }
}

@media (max-width: 360px) {
    .ff-loader-spinner {
        width: 50px;
        height: 50px;
    }
    .ff-loader-percent {
        font-size: 13px;
    }
    .ff-loader-bar {
        width: 160px;
    }
}

/* ==========================================
   DRAWER - SIDEBAR
   ========================================== */

.ff-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.ff-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.ff-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100%;
    background: #0d0d1a;
    z-index: 999999;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ff-drawer.open {
    right: 0;
}

/* Drawer Header */
.ff-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ff-drawer-user {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.ff-drawer-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 0, 0.2);
}

.ff-drawer-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.ff-drawer-user-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 2px 0;
}

.ff-drawer-user-info span {
    font-size: 13px;
    color: #9999aa;
}

.ff-drawer-close {
    background: none;
    border: none;
    color: #9999aa;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
    line-height: 1;
}

.ff-drawer-close:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

/* Drawer Balance */
.ff-drawer-balance {
    margin: 12px 20px;
    padding: 14px 18px;
    background: rgba(255, 107, 0, 0.06);
    border: 1px solid rgba(255, 107, 0, 0.08);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ff-drawer-balance-label {
    font-size: 14px;
    color: #9999aa;
}

.ff-drawer-balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b00;
}

/* Drawer Navigation */
.ff-drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    flex: 1;
}

.ff-drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: #9999aa;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ff-drawer-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.ff-drawer-nav-item.active {
    background: rgba(255, 107, 0, 0.06);
    color: #ff6b00;
}

.ff-drawer-nav-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.ff-drawer-nav-label {
    flex: 1;
}

.ff-drawer-nav-logout {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 16px;
    color: #dc3545;
}

.ff-drawer-nav-logout:hover {
    background: rgba(220, 53, 69, 0.06);
    color: #dc3545;
}

/* Drawer Footer */
.ff-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

.ff-drawer-footer p {
    font-size: 12px;
    color: #666677;
    margin: 0;
}

.ff-drawer-version {
    font-size: 11px;
    color: #444455;
    margin-top: 2px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    /* ✅ নেভিগেশন লুকান */
    .ff-header-nav {
        display: none !important;
    }
    
    /* ✅ মোবাইল টগল দেখান */
    .ff-mobile-toggle {
        display: flex;
    }
    
    .ff-brand {
        font-size: 20px;
    }
    
    .ff-header-container {
        padding: 0 16px;
        gap: 10px;
    }
    
    .ff-header-balance {
        font-size: 14px;
        padding: 4px 12px;
    }
    
    .ff-profile-toggle img {
        width: 30px;
        height: 30px;
    }
    
    .ff-profile-icon {
        font-size: 24px;
    }
    
    .ff-header-right {
        gap: 10px;
    }
    
    .ff-drawer {
        width: 300px;
        right: -320px;
    }
    
    .ff-drawer-header {
        padding: 18px 16px 12px;
    }
    
    .ff-drawer-avatar img,
    .ff-drawer-avatar-placeholder {
        width: 44px;
        height: 44px;
    }
    
    .ff-drawer-user-info h4 {
        font-size: 14px;
    }
    
    .ff-drawer-user-info span {
        font-size: 12px;
    }
    
    .ff-drawer-balance {
        margin: 8px 16px;
        padding: 10px 14px;
    }
    
    .ff-drawer-balance-amount {
        font-size: 16px;
    }
    
    .ff-drawer-nav-item {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .ff-drawer-nav-icon {
        font-size: 18px;
        width: 28px;
    }
}

@media (max-width: 480px) {
    .ff-brand {
        font-size: 18px;
    }
    
    .ff-mobile-toggle span {
        width: 22px;
        height: 2px;
    }
    
    .ff-header-balance {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .ff-profile-toggle img {
        width: 26px;
        height: 26px;
    }
    
    .ff-profile-icon {
        font-size: 20px;
    }
    
    .ff-header-right {
        gap: 6px;
    }
    
    .ff-drawer {
        width: 280px;
        right: -300px;
    }
    
    .ff-drawer-nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .ff-brand {
        font-size: 16px;
    }
    
    .ff-mobile-toggle span {
        width: 20px;
        height: 2px;
    }
    
    .ff-header-balance {
        font-size: 11px;
        padding: 2px 8px;
    }
}

/* ✅ Body class when drawer is open */
body.drawer-open {
    overflow: hidden;
}