/* ==========================================
   IQ PWA - Main Styles
   Matching Android App Theme
   ========================================== */

/* CSS Variables - Modern Design System */
:root {
    /* Premium Gold Theme */
    --gold-primary: #FFC107;
    --gold-secondary: #FFD54F;
    --gold-light: #FFE082;
    --gold-dark: #F57C00;
    --gold-gradient: linear-gradient(135deg, #FFC107 0%, #FFD54F 50%, #FFE082 100%);
    
    /* Modern Blue Accent */
    --accent-blue: #2196F3;
    --accent-blue-light: #64B5F6;
    --accent-blue-dark: #1976D2;
    --blue-gradient: linear-gradient(135deg, #1976D2 0%, #2196F3 50%, #64B5F6 100%);
    
    /* Success Green */
    --accent-green: #4CAF50;
    --accent-green-light: #81C784;
    --accent-green-dark: #388E3C;
    --green-gradient: linear-gradient(135deg, #388E3C 0%, #4CAF50 50%, #81C784 100%);
    
    /* Error & Warning */
    --error-red: #F44336;
    --error-red-light: #EF5350;
    --error-red-dark: #D32F2F;
    --warning-orange: #FF9800;
    
    /* Modern Backgrounds */
    --bg-light: #FAFAFA;
    --bg-dark: #0A0A0B;
    --bg-gradient-dark: linear-gradient(180deg, #0A0A0B 0%, #1A1A1B 100%);
    --bg-gradient-light: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    
    /* Glass Morphism */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(10px);
    
    /* Surface Colors */
    --surface-light: #FFFFFF;
    --surface-dark: #1A1A1B;
    --surface-variant-light: #F8F8F8;
    --surface-variant-dark: #242426;
    --surface-elevated: rgba(255, 255, 255, 0.05);
    
    /* Text Colors */
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #FFFFFF;
    --text-dark: #000000;
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Special Features */
    --harvest-green: #66BB6A;
    --package-blue: #42A5F5;
    --wheel-orange: #FF9800;
    --agent-purple: #9C27B0;
    --event-purple: #9370DB;
    
    /* Modern Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.20);
    --shadow-glow: 0 0 20px rgba(255, 193, 7, 0.3);
    
    /* Animations */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;
    
    /* Z-Index Layers */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-splash: 900;
}

/* Global Styles - Modern Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-gradient-light);
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}

/* Dark Mode Support */
body.dark-mode {
    background: var(--bg-gradient-dark);
    color: var(--text-light);
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* Selection Colors */
::selection {
    background-color: var(--gold-primary);
    color: var(--text-light);
}

::-moz-selection {
    background-color: var(--gold-primary);
    color: var(--text-light);
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 { 
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
}
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    background: linear-gradient(135deg, var(--text-light) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-blue-dark);
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-splash);
}

.splash-content {
    text-align: center;
    color: var(--text-light);
}

.logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
}

.logo-circle {
    width: 100%;
    height: 100%;
    background: var(--surface-light);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.logo-text {
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-round);
    animation: ring-pulse 2s infinite;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: var(--spacing-xl);
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    margin: 0 auto var(--spacing-md);
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    animation: loading-progress 2s ease-in-out infinite;
}

.loading-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface-light);
    box-shadow: var(--shadow-light);
    z-index: var(--z-sticky);
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    opacity: 1;
}

.header-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
}

.menu-btn,
.notification-btn,
.refresh-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-round);
    transition: background 0.3s ease;
    position: relative;
}

.menu-btn:hover,
.notification-btn:hover,
.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-center {
    flex: 1;
    text-align: center;
    margin: 0 var(--spacing-md);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

.header-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--error-red);
    color: var(--text-light);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    bottom: 0;
    width: 280px;
    z-index: var(--z-modal);
    transition: left 0.3s ease;
}

.side-menu.active {
    left: 0;
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-menu.active .side-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

.side-menu-content {
    position: relative;
    width: 280px;
    height: 100%;
    background: var(--surface-light);
    box-shadow: var(--shadow-large);
    overflow-y: auto;
}

.side-menu-header {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    padding: var(--spacing-lg) var(--spacing-md);
    color: var(--text-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar .material-icons {
    font-size: 32px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.user-email {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.side-menu-nav {
    padding: var(--spacing-md) 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    transition: background 0.3s ease;
}

.menu-item:hover {
    background: var(--surface-variant-light);
}

.menu-item.active {
    background: rgba(255, 193, 7, 0.1);
    color: var(--gold-dark);
    border-right: 3px solid var(--gold-primary);
}

.menu-divider {
    margin: var(--spacing-md) 0;
    border: none;
    border-top: 1px solid var(--surface-variant-light);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 72px var(--spacing-md) 80px;
    min-height: 100vh;
}

/* Bottom Navigation */
.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface-light);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-sticky);
}

.nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    position: relative;
}

.nav-item:hover {
    color: var(--gold-primary);
}

.nav-item.active {
    color: var(--gold-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--gold-primary);
}

.nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
}

/* Animations */
@keyframes ring-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

@keyframes loading-progress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse-animation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse-animation 2s ease-in-out infinite;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .main-content {
        padding: 80px var(--spacing-lg) 88px;
    }
    
    .bottom-navigation {
        height: 64px;
    }
    
    .nav-item .material-icons {
        font-size: 28px;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
}
