/* ================================================================
   FIGIG EXAMS - TARGETED MOBILE FIXES
   Minimal, targeted fixes for specific mobile issues
   ================================================================ */

/* ================================================================
   1. SIDEBAR FIX: Avatar menu always visible (no scrolling)
   ================================================================ */

/* Limit sidebar header height to make space for avatar menu */
.sidebar-header {
    min-height: 70px !important;
    padding: var(--space-4) !important;
}

/* Reduce nav padding to save vertical space */
.sidebar-nav {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    padding: var(--space-3) var(--space-4) !important;
}

/* Reduce nav item spacing */
.nav-item {
    padding: 10px 14px !important;
    margin-bottom: 6px !important;
}

/* Ensure sidebar user section is always visible at bottom */
.sidebar-user {
    flex-shrink: 0 !important;
    padding: var(--space-4) !important;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%) !important;
    margin-top: auto !important;
    z-index: 10 !important;
}

/* User dropdown positioned above user section */
.user-dropdown {
    bottom: 70px !important;
}

/* ================================================================
   2. PROFILE PAGE: Transform hero into a card & fix white space
   ================================================================ */

@media (max-width: 768px) {
    /* Transform profile hero into a clean card */
    .profile-hero {
        padding: var(--space-5) !important;
        background: white !important;
        border-radius: var(--radius-xl) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid var(--gray-200) !important;
        margin-bottom: var(--space-4) !important;
        position: relative !important;
    }

    /* Remove the background gradient overlay on mobile */
    .profile-hero .hero-background {
        display: none !important;
    }

    /* Adjust hero content for card layout */
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: var(--space-4) !important;
    }

    /* Avatar section in card */
    .avatar-circle {
        background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-purple) 100%) !important;
        border: 4px solid var(--gray-100) !important;
    }

    /* User info text colors for card */
    .profile-hero .user-name {
        color: var(--gray-900) !important;
        text-shadow: none !important;
    }

    .profile-hero .user-email {
        color: var(--gray-600) !important;
    }

    /* Badges styling for card */
    .profile-hero .badge-active,
    .profile-hero .badge-inactive {
        background: var(--success-100) !important;
        color: var(--success-700) !important;
        border-color: var(--success-300) !important;
    }

    .profile-hero .badge-member {
        background: var(--primary-100) !important;
        color: var(--primary-700) !important;
        border-color: var(--primary-300) !important;
    }

    /* Reduce profile content grid top padding */
    .profile-content-grid {
        padding-top: var(--space-4) !important;
    }
}

/* ================================================================
   3. PROFILE PAGE: Fix exam history cards text structure
   ================================================================ */

@media (max-width: 768px) {
    /* Ensure history cards stack properly */
    .history-timeline {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--space-3) !important;
        padding: var(--space-4) !important;
    }

    /* Fix history card layout */
    .history-item {
        display: flex !important;
        gap: var(--space-3) !important;
        align-items: flex-start !important;
    }

    /* History dot - consistent size */
    .history-dot {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        flex-shrink: 0 !important;
    }

    /* Ensure history content doesn't overflow */
    .history-content {
        flex: 1 !important;
        min-width: 0 !important;
        padding: var(--space-4) !important;
    }

    /* Fix header layout - title and score badge */
    .history-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: var(--space-3) !important;
        margin-bottom: var(--space-3) !important;
    }

    .history-header h4 {
        flex: 1 !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 1rem !important;
        line-height: 1.4 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }

    /* Score badge - ensure it stays on one line */
    .score-badge {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 0.875rem !important;
        padding: var(--space-1) var(--space-3) !important;
    }

    /* History meta - proper spacing and alignment */
    .history-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: var(--space-2) var(--space-3) !important;
        align-items: center !important;
    }

    .meta-item {
        display: flex !important;
        align-items: center !important;
        gap: var(--space-1) !important;
        font-size: 0.8125rem !important;
        white-space: nowrap !important;
    }

    .meta-item i {
        font-size: 0.875rem !important;
    }

    .meta-badge {
        font-size: 0.75rem !important;
        padding: var(--space-1) var(--space-2) !important;
        white-space: nowrap !important;
    }
}
