/**
 * BrightIQ Student Dashboard Styles
 * Beautiful, gamified frontend dashboard for students
 */

/* Modal Overlay */
.brightiq-student-dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.brightiq-student-dashboard-overlay.active {
    display: flex;
    opacity: 1;
}

/* Dashboard Container */
.brightiq-student-dashboard {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    margin: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.brightiq-student-dashboard-overlay.active .brightiq-student-dashboard {
    transform: scale(1);
}

/* Header */
.brightiq-dashboard-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brightiq-dashboard-title-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brightiq-dashboard-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brightiq-dashboard-title-text h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brightiq-dashboard-title-text p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.brightiq-dashboard-level-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brightiq-level-number {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.brightiq-level-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.brightiq-dashboard-close {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.brightiq-dashboard-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Content Area */
.brightiq-dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: rgba(255, 255, 255, 0.05);
}

.brightiq-dashboard-content::-webkit-scrollbar {
    width: 8px;
}

.brightiq-dashboard-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.brightiq-dashboard-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* Grid Layout */
.brightiq-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Cards */
.brightiq-dashboard-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.brightiq-dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.brightiq-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.brightiq-card-icon {
    font-size: 32px;
}

.brightiq-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.brightiq-card-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
}

/* Stats Cards */
.brightiq-stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.brightiq-stat-icon {
    font-size: 40px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.brightiq-stat-content h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.brightiq-stat-content p {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* Progress Circle */
.brightiq-progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.brightiq-progress-circle svg {
    transform: rotate(-90deg);
}

.brightiq-progress-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 8;
}

.brightiq-progress-circle-fill {
    fill: none;
    stroke: white;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.brightiq-progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.brightiq-progress-circle-number {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.brightiq-progress-circle-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Achievement Badges */
.brightiq-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.brightiq-achievement-badge {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.brightiq-achievement-badge.unlocked {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.brightiq-achievement-badge.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.brightiq-achievement-badge:hover {
    transform: scale(1.05);
}

.brightiq-achievement-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.brightiq-achievement-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.brightiq-achievement-desc {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
}

.brightiq-achievement-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.brightiq-achievement-rarity.common {
    background: #d1d5db;
    color: #4b5563;
}

.brightiq-achievement-rarity.rare {
    background: #60a5fa;
    color: white;
}

.brightiq-achievement-rarity.epic {
    background: #a78bfa;
    color: white;
}

.brightiq-achievement-rarity.legendary {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
}

.brightiq-achievement-progress {
    margin-top: 8px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.brightiq-achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    transition: width 0.5s ease;
}

/* Tutor Cards */
.brightiq-tutor-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: all 0.3s ease;
}

.brightiq-tutor-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.brightiq-tutor-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.brightiq-tutor-info {
    flex: 1;
}

.brightiq-tutor-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.brightiq-tutor-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.brightiq-tutor-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #6b7280;
}

.brightiq-tutor-level {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Progress Bar */
.brightiq-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.brightiq-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Timeline */
.brightiq-timeline {
    position: relative;
    padding-left: 32px;
}

.brightiq-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
}

.brightiq-timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.brightiq-timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
}

.brightiq-timeline-content {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brightiq-timeline-date {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 4px 0;
}

.brightiq-timeline-text {
    font-size: 14px;
    color: #1f2937;
    margin: 0;
}

/* Challenges */
.brightiq-challenge-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    margin-bottom: 16px;
}

.brightiq-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.brightiq-challenge-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.brightiq-challenge-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.brightiq-challenge-reward {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.brightiq-challenge-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

/* Streak Calendar */
.brightiq-streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.brightiq-streak-day {
    aspect-ratio: 1;
    border-radius: 6px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.brightiq-streak-day.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.4);
}

.brightiq-streak-day.today {
    border: 2px solid #667eea;
}

/* Loading State */
.brightiq-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.brightiq-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: brightiq-spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Confetti Animation */
@keyframes brightiq-confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.brightiq-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    animation: brightiq-confetti-fall 3s linear forwards;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .brightiq-student-dashboard {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .brightiq-dashboard-header {
        padding: 16px;
    }
    
    .brightiq-dashboard-title-section {
        gap: 12px;
    }
    
    .brightiq-dashboard-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .brightiq-dashboard-title-text h1 {
        font-size: 20px;
    }
    
    .brightiq-dashboard-content {
        padding: 16px;
    }
    
    .brightiq-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .brightiq-achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
