/* ============================================= */
/* 🎨 PIMS PREMIUM DESIGN SYSTEM - MOBILE FIRST */
/* ============================================= */

/* Import Premium Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ============================================= */
/* 📱 BASE STYLES - MOBILE FIRST */
/* ============================================= */

:root {
    /* Primary Colors */
    --primary: #0A2463;
    --primary-light: #1e3a8a;
    --primary-dark: #051b4a;
    --secondary: #FBBF24;
    --secondary-light: #fcd34d;
    --secondary-dark: #f59e0b;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --purple: #8B5CF6;
    --pink: #EC4899;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0A2463 0%, #1e3a8a 50%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #f97316 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    --gradient-sunset: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px -12px rgba(10,36,99,0.25);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.02);
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================= */
/* 🎯 CUSTOM SCROLLBAR */
/* ============================================= */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ============================================= */
/* 📱 MOBILE-FIRST LAYOUT */
/* ============================================= */

/* Container */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* Responsive Container */
@media (min-width: 640px) {
    .container { max-width: 640px; }
}
@media (min-width: 768px) {
    .container { max-width: 768px; }
}
@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}
@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* ============================================= */
/* 🏆 PREMIUM CARDS */
/* ============================================= */

/* Base Card */
.premium-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(10, 36, 99, 0.05);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(10, 36, 99, 0.1);
}

.premium-card:hover::before {
    opacity: 1;
}

/* Mobile Card */
.mobile-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    margin-bottom: var(--space-4);
}

.mobile-card:active {
    transform: scale(0.98);
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--secondary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card i {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    font-size: 3rem;
    opacity: 0.1;
    color: var(--primary);
    transition: all var(--transition-base);
}

.stat-card:hover i {
    transform: scale(1.2) rotate(5deg);
    opacity: 0.2;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-4);
    }
}

/* ============================================= */
/* 🎨 GRADIENTS */
/* ============================================= */

.gradient-primary {
    background: var(--gradient-primary);
}

.gradient-secondary {
    background: var(--gradient-secondary);
}

.gradient-success {
    background: var(--gradient-success);
}

.gradient-danger {
    background: var(--gradient-danger);
}

.gradient-purple {
    background: var(--gradient-purple);
}

/* ============================================= */
/* 🔘 BUTTONS */
/* ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px; /* Mobile-friendly touch target */
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(10, 36, 99, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(10, 36, 99, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

/* Icon Button */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================= */
/* 📝 FORM ELEMENTS */
/* ============================================= */

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.form-label i {
    color: var(--primary);
    margin-right: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: white;
    min-height: 48px; /* Mobile-friendly touch target */
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 36, 99, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230A2463'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    background-size: 1.2rem;
    padding-right: var(--space-10);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================= */
/* 📊 TABLES */
/* ============================================= */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: white;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.table th {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table th:first-child {
    border-top-left-radius: var(--radius-lg);
}

.table th:last-child {
    border-top-right-radius: var(--radius-lg);
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition-fast);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--gray-50);
}

/* ============================================= */
/* 🔔 BADGES */
/* ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.7rem;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(10, 36, 99, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
}

/* Role Badges */
.role-badge {
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.role-admin {
    background: var(--primary);
    color: white;
}

.role-teacher {
    background: var(--secondary);
    color: var(--primary);
}

.role-student {
    background: var(--success);
    color: white;
}

/* Status Badges */
.status-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.7rem;
}

.status-present {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-absent {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-late {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-leave {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ============================================= */
/* 📱 HEADER & NAVIGATION */
/* ============================================= */

.app-header {
    background: white;
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 var(--space-4);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text small {
    display: block;
    font-size: 0.6rem;
    color: var(--gray-500);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition-base);
    position: relative;
}

.header-btn:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.header-btn:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ============================================= */
/* 📱 TABS SYSTEM - HORIZONTAL SCROLL */
/* ============================================= */

.tabs-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.tabs-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-1) 0 var(--space-3) 0;
}

.tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs-flex {
    display: inline-flex;
    gap: var(--space-2);
    min-width: 100%;
    padding: 0 var(--space-2);
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    min-height: 44px;
}

.tab-item i {
    font-size: 1rem;
}

.tab-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-item:active {
    transform: scale(0.96);
}

/* Scroll Buttons (Desktop) */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.tabs-container:hover .scroll-btn {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn.left {
    left: 0;
}

.scroll-btn.right {
    right: 0;
}

.scroll-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
    .scroll-btn {
        display: none;
    }
}

/* ============================================= */
/* 👤 PROFILE CARDS */
/* ============================================= */

.profile-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.3);
    margin-bottom: var(--space-4);
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-1);
}

.profile-info p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.profile-role {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: var(--space-2);
}

/* ============================================= */
/* 📊 PROGRESS BARS */
/* ============================================= */

.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* ============================================= */
/* 🔔 TOAST NOTIFICATIONS */
/* ============================================= */

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    border-left: 4px solid var(--primary);
    animation: slideUp 0.3s ease;
    pointer-events: auto;
    border: 1px solid var(--gray-200);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.toast-close {
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition-fast);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================= */
/* 🎯 MODALS */
/* ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ============================================= */
/* 📱 RESPONSIVE UTILITIES */
/* ============================================= */

/* Hide on mobile */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Flex Grid */
.flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.flex-grid > * {
    flex: 1 1 250px;
}

/* ============================================= */
/* 🎨 ANIMATIONS */
/* ============================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================= */
/* 📱 MOBILE-SPECIFIC OPTIMIZATIONS */
/* ============================================= */

/* Better touch targets */
@media (max-width: 768px) {
    button, 
    .btn,
    .tab-item,
    .header-btn,
    .form-input,
    .form-select {
        min-height: 48px;
    }
    
    .btn-sm {
        min-height: 40px;
    }
    
    /* Increase spacing */
    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    
    /* Stack grids */
    .stats-grid {
        gap: var(--space-2);
    }
    
    /* Larger fonts */
    body {
        font-size: 16px;
    }
    
    /* Better card padding */
    .mobile-card {
        padding: var(--space-3);
    }
}

/* Landscape optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        max-height: 85vh;
    }
    
    .profile-card {
        padding: var(--space-4);
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--gray-900);
        color: var(--gray-200);
    }
    
    .premium-card,
    .mobile-card,
    .stat-card {
        background: var(--gray-800);
        border-color: var(--gray-700);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: var(--gray-800);
        border-color: var(--gray-700);
        color: var(--gray-200);
    }
    
    .app-header {
        background: rgba(31, 41, 55, 0.95);
    }
}