/*  
 * QMB Header Component Styles - Enhanced Version
 * File: /qmbportal/quizzes/assets/css/components/header.css
 * 
 * Enhanced header with strategic improvements for better engagement
 * while maintaining professional appearance for elementary students
 */

/* Header Main Container */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 100%);
    border-bottom: 5px solid transparent;
    background-clip: padding-box;
    color: var(--dark-gray);
    padding: 18px 28px 8px 28px;
    position: relative;
    overflow: hidden;
}

/* Enhanced gradient top border */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--golden) 0%, var(--golden-dark) 30%, var(--orange) 70%, var(--orange-dark) 100%);
}

/* Subtle background geometric element */
.header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(244, 208, 63, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

/* Header Information Section */
.header-info {
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: space-between;
    gap: 28px;
    position: relative;
    z-index: 2;
}

/* Logo Section */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
}

.header-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 28px;
    color: transparent;
    box-shadow: 0 4px 16px rgba(244, 208, 63, 0.25);
    transition: all 0.3s ease;
    position: relative;
    object-fit: cover;
}

/* For actual image logos */
.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.header-logo:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(244, 208, 63, 0.35);
}

.header-logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--golden), var(--orange));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-logo:hover::before {
    opacity: 0.3;
}

/* Brand text with gradient */
.brand-text {
    font-size: 15px;
    font-weight: lighter;
    background: linear-gradient(135deg, var(--dark-gray) 0%, #34495e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Activity Information */
.activity-info {
    text-align: center;
    position: relative;
}

.activity-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-gray);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.activity-description {
    font-size: 15px;
    color: #5d6d7e;
    font-weight: 600;
    background: rgba(244, 208, 63, 0.08);
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(244, 208, 63, 0.2);
    line-height: 1.4;
}

/* Activity Icon */
.header-act-logo {
    font-size: 32px;
    display: flex;
    background-color: transparent;
    height: 60px;
    border-radius: 15px;
    transform: rotate(-5deg);
    transition: all 0.3s ease;
}

.header-act-logo:hover {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Student Progress Section */
.student-progress {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: auto;
}

.progress-stat::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg, var(--golden), var(--orange));
    border-radius: 12px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-stat:hover::before {
    opacity: 1;
}

.progress-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 208, 63, 0.15);
}

.progress-stat-label {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.progress-stat:hover .progress-stat-label {
    transform: scale(1.2);
}

.progress-stat-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-gray);
    min-width: 24px;
    text-align: center;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* ============================================
   LEARNING LEVEL SECTION
   ============================================ */
.learning-level {
    background: var(--white);
    padding: var(--spacing-sm) var(--spacing-2xl);
    display: block;
    border-bottom: 3px solid var(--golden);
    position: relative;
}

/* Main header row that contains level info, student name, and teacher indicator */
.level-header-row {
    display: flex;
    justify-content:space-evenly;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

/* Level information section */
.level-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1 1 auto;
}

.level-badge {
    background: linear-gradient(45deg, var(--golden), var(--golden-dark));
    color: var(--dark-gray);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
    white-space: nowrap;
}

.level-badge:hover {
    transform: translateY(-2px);
}

.level-description {
    color: var(--medium-gray);
    font-size: 1rem;
    font-style: italic;
    font-weight: 500;
}

/* Student Name Section */
.student-name-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-lg);
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(102, 126, 234, 0.2);
    flex: 0 0 auto;
}

.reset-btn-section {
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.reset-btn-section:hover {
    transform: translateY(-2px);
}
.reset-btn-section:active {
    transform: translateY(0);
}

.student-greeting {
    color: var(--dark-gray);
    font-size: 0.95rem;
    font-weight: 500;
}

.student-greeting strong {
    color: #667eea;
    font-weight: 700;
}

.student-name-section .btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
    transition: color var(--transition-normal);
    white-space: nowrap;
}

.student-name-section .btn-link:hover {
    color: #764ba2;
}

/* Teacher Indicator */
.teacher-indicator {
    color: var(--medium-gray);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    opacity: 0.8;
    transition: opacity var(--transition-normal);
    flex: 0 0 auto;
}

.teacher-indicator:hover {
    opacity: 1;
}

.teacher-indicator-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Progress Indicator Bar */
.progress-indicator {
    background: var(--light-gray);
    height: 10px;
    border-radius: var(--radius-sm);
    margin: var(--spacing-md) var(--spacing-2xl) var(--spacing-sm);
    overflow: hidden;
    border: 2px solid var(--golden);
    position: relative;
}

.progress-bar {
    background: linear-gradient(45deg, var(--golden), var(--orange));
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Timer specific styling */
#timer {
    font-family: 'Courier New', monospace;
    min-width: 48px;
}

/* Progress pulse animation for active stats */
@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-stat[data-active="true"] {
    animation: progressPulse 2s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1366px) {
    .header-info {
        gap: 20px;
    }
    
    .student-progress {
        margin-top: 12px;
        gap: 10px;
    }
    
    .progress-stat {
        padding: 8px 12px;
    }
    
    .activity-title {
        font-size: 22px;
    }
    
    .activity-description {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }
    
    .header-info {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .logo-section {
        justify-content: center;
    }
    
    .student-progress {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 16px;
    }
    
    /* Learning level responsive */
    .level-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .level-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .student-name-section {
        justify-content: center;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .teacher-indicator {
        justify-content: center;
    }
    
    .activity-title {
        font-size: 20px;
    }
    
    .activity-description {
        font-size: 13px;
        padding: 5px 12px;
    }
    
    .header-logo {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .brand-text {
        display: none;
    }
    
    .header-act-logo {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .learning-level {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .student-progress {
        gap: 6px;
    }
    
    .progress-stat {
        padding: 6px 10px;
        min-width: auto;
    }
    
    .progress-stat-label {
        font-size: 16px;
    }
    
    .progress-stat-number {
        font-size: 14px;
    }
    
    .level-badge {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .level-description {
        font-size: 0.9rem;
    }
    
    .student-greeting {
        font-size: 0.9rem;
    }
    
    .student-name-section .btn-link {
        font-size: 0.8rem;
    }
    
    .activity-title {
        font-size: 18px;
    }
    
    .activity-description {
        font-size: 12px;
    }
    
    .header-logo {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    .header-act-logo {
        width: 50px;
        height: 50px;
        font-size: 13px;
    }
    
    .progress-indicator {
        margin: var(--spacing-sm) var(--spacing-md);
    }
}

/* Print styles for header */
@media print {
    .header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #ccc;
    }
    
    .header::before,
    .header::after {
        display: none;
    }
    
    .student-progress {
        display: none;
    }
    
    .student-name-section {
        background: none !important;
        border: 1px solid #ccc !important;
    }
}