/**
 * EXAM UPDATES - MOBILE-FIRST CSS
 * Upload to: /public_html/public/assets/css/exam-updates-mobile.css
 * 
 * Design Philosophy: Mobile-first, professional, app-like experience
 * Base: 375px (iPhone), Enhanced: 768px (Tablet), 1024px+ (Desktop)
 * 
 * COMPLETELY SEPARATE - Does not depend on main.css or any other file
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Backgrounds */
    --bg-page: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-white: #ffffff;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 28px;
    
    /* Touch Targets */
    --touch-target: 48px;
    
    /* Header Heights */
    --header-height: 64px;
    --filter-height: 56px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   MOBILE PAGE HEADER
   ======================================== */

.exam-updates-page {
    min-height: 100vh;
    padding-bottom: var(--space-xl);
}

.exam-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.exam-header-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.exam-header-icon {
    font-size: var(--font-size-2xl);
}

.exam-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.exam-header-btn {
    width: var(--touch-target);
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-white);
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.exam-header-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   FILTER CHIPS (Horizontal Scroll)
   ======================================== */

.exam-filters {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: var(--filter-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
    box-shadow: var(--shadow-sm);
}

.filter-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.filter-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    height: 100%;
    white-space: nowrap;
}

.filter-chip {
    height: 40px;
    padding: 0 var(--space-md);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.filter-chip:active {
    transform: scale(0.95);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-white);
    border-color: var(--primary);
}

.filter-chip-icon {
    font-size: var(--font-size-base);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.exam-content {
    margin-top: calc(var(--header-height) + var(--filter-height));
    padding: var(--space-md);
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-top: var(--space-sm);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-icon {
    font-size: var(--font-size-2xl);
}

.section-action {
    color: var(--primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   UPDATE CARDS (Mobile-Optimized)
   ======================================== */

.updates-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.update-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.update-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.update-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.update-badges {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.update-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-jee {
    background: #dbeafe;
    color: #1e40af;
}

.badge-neet {
    background: #dcfce7;
    color: #166534;
}

.badge-cbse {
    background: #fef3c7;
    color: #92400e;
}

.badge-ib {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-sat {
    background: #fce7f3;
    color: #9f1239;
}

.badge-notification {
    background: #fef2f2;
    color: #991b1b;
}

.badge-result {
    background: #ecfdf5;
    color: #065f46;
}

.badge-datesheet {
    background: #f0f9ff;
    color: #075985;
}

.badge-important {
    background: #fef3c7;
    color: #92400e;
}

.update-card-bookmark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.update-card-bookmark:active {
    transform: scale(0.9);
}

.update-card-bookmark.active {
    background: var(--accent);
    color: var(--text-white);
}

.update-card-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.update-card-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.update-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.update-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.update-card-actions {
    display: flex;
    gap: var(--space-sm);
}

.update-btn {
    flex: 1;
    height: var(--touch-target);
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.update-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-white);
}

.update-btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.update-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.update-btn-secondary:active {
    transform: scale(0.98);
    background: var(--border-color);
}

/* ========================================
   CALENDAR CARDS
   ======================================== */

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.calendar-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.calendar-card-date {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.calendar-date-box {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-date-day {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1;
}

.calendar-date-month {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-card-info {
    flex: 1;
}

.calendar-card-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.calendar-card-event {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-card-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    line-height: 1.5;
}

.calendar-card-actions {
    margin-top: var(--space-sm);
    display: flex;
    gap: var(--space-sm);
}

/* ========================================
   LINK CARDS
   ======================================== */

.links-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.link-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.link-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.link-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.link-card-content {
    flex: 1;
    min-width: 0;
}

.link-card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-card-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-card-arrow {
    color: var(--text-tertiary);
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-xl) auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   TABLET STYLES (768px+)
   ======================================== */

@media (min-width: 768px) {
    :root {
        --header-height: 72px;
        --filter-height: 64px;
    }
    
    .exam-content {
        padding: var(--space-lg);
    }
    
    .updates-grid,
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .links-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

/* ========================================
   DESKTOP STYLES (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    .exam-content {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
        padding: var(--space-xl);
    }
    
    .updates-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-lg);
    }
    
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    .links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
    
    .update-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
    
    .link-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.hidden { display: none; }

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
