/**
 * Dashboard Duolingo Styles - Unified Topbar & Bottom Nav
 * أنماط Dashboard Duolingo - الشريط العلوي والقائمة السفلية الموحدة
 * 
 * @package FitnessCoachPro
 * @version 1.0.0
 */

/* ============================================================================
   CSS VARIABLES - DUOLINGO COLOR PALETTE
   ============================================================================ */
:root {
    /* Duolingo Colors */
    --duo-green: #58cc02;
    --duo-green-dark: #46a302;
    --duo-green-light: #7cdb36;
    --duo-green-glow: rgba(88, 204, 2, 0.4);

    --duo-blue: #1cb0f6;
    --duo-blue-dark: #1899d6;

    --duo-purple: #a855f7;
    --duo-orange: #ff9600;
    --duo-red: #ff4b4b;
    --duo-yellow: #ffc800;
    --duo-gold: #ffd700;

    /* Dark Theme */
    --duo-bg-deep: #0a1014;
    --duo-bg: #0f1a1f;
    --duo-bg-light: #162229;
    --duo-bg-card: #1a2c35;
    --duo-bg-elevated: #213640;

    /* Text */
    --duo-text: #ffffff;
    --duo-text-secondary: #b8cdd6;
    --duo-text-muted: #6b8a97;

    /* Glass Effect */
    --glass-bg: rgba(26, 44, 53, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Layers */
    --z-base: 1;
    --z-topbar: 100;
    --z-bottom-nav: 9999;
}

/* ============================================================================
   BASE STYLES - HTML & BODY
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
    background: var(--duo-bg-deep) !important;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif !important;
    background: var(--duo-bg-deep) !important;
    color: var(--duo-text) !important;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl !important;
}

/* Override WordPress and Theme Styles */
body.admin-bar {
    padding-top: 0 !important;
}

body #page,
body #content,
body .site,
body .site-content,
body #primary,
body #main,
body main {
    background: transparent !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================================
   TOP NAVIGATION BAR (duo-topbar)
   ============================================================================ */
.duo-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: linear-gradient(180deg, rgba(15, 26, 31, 0.95) 0%, var(--duo-bg-deep) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 8px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: var(--z-topbar) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    direction: rtl !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Logout Button */
.duo-logout-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 75, 75, 0.1);
    border: 2px solid rgba(255, 75, 75, 0.3);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.duo-logout-btn:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: var(--duo-red);
    transform: scale(1.05);
}

.duo-logout-btn .logout-icon {
    font-size: 24px;
    display: block;
}

/* Badges Container (Right Side) */
.duo-topbar > div:not(.duo-logout-btn) {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Streak Badge */
.duo-streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 150, 0, 0.1);
    border: 2px solid rgba(255, 150, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-weight: 700;
    font-size: 16px;
    color: var(--duo-text);
    transition: all var(--transition-smooth);
}

.duo-streak-badge:hover {
    background: rgba(255, 150, 0, 0.2);
    border-color: var(--duo-orange);
    transform: translateY(-2px);
}

.duo-streak-badge .streak-flame {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(255, 150, 0, 0.6));
    animation: flame-pulse 2s ease-in-out infinite;
}

@keyframes flame-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* XP Badge */
.duo-xp-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 200, 0, 0.1);
    border: 2px solid rgba(255, 200, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-weight: 700;
    font-size: 16px;
    color: var(--duo-text);
    transition: all var(--transition-smooth);
}

.duo-xp-badge:hover {
    background: rgba(255, 200, 0, 0.2);
    border-color: var(--duo-yellow);
    transform: translateY(-2px);
}

.duo-xp-badge > span:first-child {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.6));
}

/* Level Badge */
.duo-level-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-weight: 700;
    font-size: 16px;
    color: var(--duo-text);
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.duo-level-badge:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--duo-purple);
    transform: translateY(-2px);
}

/* ============================================================================
   BOTTOM NAVIGATION BAR (duo-bottom-nav)
   ============================================================================ */
.duo-bottom-nav,
body .duo-bottom-nav,
html .duo-bottom-nav,
.site .duo-bottom-nav,
nav.duo-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 68px !important;
    z-index: var(--z-bottom-nav) !important;
    background: linear-gradient(180deg, rgba(15, 26, 31, 0.95) 0%, var(--duo-bg-deep) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid var(--glass-border) !important;
    padding: 8px 8px 12px !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Navigation Items */
.duo-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--duo-text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    min-width: 52px;
    flex: 1;
    max-width: 70px;
}

.duo-nav-item:hover {
    color: var(--duo-text);
    background: var(--duo-bg-elevated);
}

.duo-nav-item.active {
    color: var(--duo-green);
}

.duo-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--duo-green);
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px var(--duo-green-glow);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all var(--transition-smooth);
    display: block;
}

.duo-nav-item:hover .nav-icon,
.duo-nav-item.active .nav-icon {
    transform: scale(1.15) translateY(-2px);
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   CONTAINER PADDING (for topbar and bottom nav)
   ============================================================================ */
.fcp-dashboard-duo {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 80px 16px 120px !important; /* Top padding for topbar, bottom padding for bottom nav */
    position: relative;
    box-sizing: border-box;
    min-height: 100vh;
    background: var(--duo-bg-deep) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================================================
   MASCOT SECTION
   ============================================================================ */
.duo-mascot-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl) var(--spacing-lg);
    background: linear-gradient(135deg,
        rgba(88, 204, 2, 0.1) 0%,
        rgba(28, 176, 246, 0.1) 50%,
        rgba(168, 85, 247, 0.1) 100%);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: var(--spacing-lg);
    opacity: 1 !important;
    visibility: visible !important;
}

.duo-mascot {
    font-size: 64px;
    animation: float-icon 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(88, 204, 2, 0.4));
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--duo-green) 0%, var(--duo-blue) 100%);
}

.duo-mascot .client-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.duo-mascot .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--duo-green) 0%, var(--duo-blue) 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    border-radius: 50%;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.duo-greeting h1 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--duo-green) 0%, var(--duo-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.duo-greeting p {
    font-size: 16px;
    color: var(--duo-text-muted);
    font-weight: 500;
}

/* ============================================================================
   XP SECTION
   ============================================================================ */
.duo-xp-section {
    margin: 0 var(--spacing-lg) var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    opacity: 1 !important;
    visibility: visible !important;
}

.duo-xp-header {
    margin-bottom: var(--spacing-md);
}

.duo-xp-level {
    font-size: 18px;
    font-weight: 700;
    color: var(--duo-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.duo-xp-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.duo-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--duo-green) 0%, var(--duo-yellow) 50%, var(--duo-orange) 100%);
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(88, 204, 2, 0.5);
    position: relative;
    overflow: hidden;
}

.duo-xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.duo-xp-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--duo-text-muted);
    font-weight: 600;
}

.duo-xp-stats strong {
    color: var(--duo-green);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) {
    .duo-topbar {
        height: 56px;
        padding: 6px 12px;
    }
    
    .duo-logout-btn {
        width: 44px;
        height: 44px;
    }
    
    .duo-logout-btn .logout-icon {
        font-size: 22px;
    }
    
    .duo-streak-badge,
    .duo-xp-badge,
    .duo-level-badge {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .duo-streak-badge .streak-flame,
    .duo-xp-badge > span:first-child {
        font-size: 18px;
    }
    
    .duo-bottom-nav {
        height: 64px;
        padding: 6px 6px 10px;
    }
    
    .duo-nav-item {
        min-width: 48px;
        max-width: 65px;
        padding: 6px 8px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-label {
        font-size: 9px;
    }
    
    .fcp-dashboard-duo {
        padding: 76px 12px 110px !important;
    }

    .duo-mascot-section {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-lg);
    }

    .duo-mascot {
        font-size: 48px;
    }

    .duo-greeting h1 {
        font-size: 24px;
    }

    .duo-xp-section {
        margin: 0 var(--spacing-md) var(--spacing-md);
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .duo-topbar {
        height: 52px;
        padding: 4px 8px;
    }
    
    .duo-logout-btn {
        width: 40px;
        height: 40px;
    }
    
    .duo-logout-btn .logout-icon {
        font-size: 20px;
    }
    
    .duo-streak-badge,
    .duo-xp-badge,
    .duo-level-badge {
        padding: 4px 10px;
        font-size: 12px;
        gap: 4px;
    }
    
    .duo-streak-badge .streak-flame,
    .duo-xp-badge > span:first-child {
        font-size: 16px;
    }
    
    .duo-bottom-nav {
        height: 60px;
        padding: 4px 4px 8px;
    }
    
    .duo-nav-item {
        min-width: 44px;
        max-width: 60px;
        padding: 4px 6px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 8px;
    }
    
    .fcp-dashboard-duo {
        padding: 72px 8px 100px !important;
    }
}
