/* Advanced UI Styles - Modern Medical Education Platform */

/* ===============================================
   CSS Custom Properties (Design Tokens)
   =============================================== */
:root {
    /* Primary Color Palette */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-primary-light: #a8b5ff;
    
    /* Secondary Colors */
    --color-success: #4CAF50;
    --color-warning: #ff9800;
    --color-danger: #ff6b6b;
    --color-info: #2196F3;
    
    /* Neutral Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-border: #e1e1e1;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-family-primary: 'Roboto', 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-modal: 2000;
    --z-notification: 3000;
    --z-tooltip: 4000;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg-primary: #1a1a2e;
    --color-bg-secondary: #16213e;
    --color-text-primary: #eee;
    --color-text-secondary: #aaa;
    --color-border: #333;
}

/* ===============================================
   Glassmorphism Effects
   =============================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===============================================
   Gradient Backgrounds
   =============================================== */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.gradient-animated {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===============================================
   Smooth Animations
   =============================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.animate-fade-in { animation: fadeIn 0.5s var(--transition-normal); }
.animate-fade-in-up { animation: fadeInUp 0.6s var(--transition-normal); }
.animate-pulse { animation: pulse 2s infinite; }

/* ===============================================
   Interactive Cards
   =============================================== */
.card-interactive {
    position: relative;
    border-radius: var(--radius-xl);
    transition: var(--transition-normal);
    overflow: hidden;
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* ===============================================
   Toast Notifications
   =============================================== */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    min-width: 300px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-success { background: var(--color-success); }
.toast.toast-warning { background: var(--color-warning); }
.toast.toast-danger { background: var(--color-danger); }
.toast.toast-info { background: var(--color-info); }

/* ===============================================
   Progress Bars with Animation
   =============================================== */
.progress-bar-animated {
    height: 8px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

/* ===============================================
   Badge / Achievement Indicator
   =============================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.badge-primary { background: var(--color-primary); color: white; }
.badge-success { background: var(--color-success); color: white; }
.badge-warning { background: var(--color-warning); color: white; }

/* Мобильная адаптация отключена */

/* ===============================================
   Accessibility
   =============================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
