/**
 * Program Portal - Student View Styling
 * Lock indicators, progress bars, exercise cards
 */

/* Program progress summary */
.program-progress-bar-container {
    margin-bottom: 24px;
    padding: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
}

.program-progress-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    font-size: 14px;
    color: #0c4a6e;
    font-weight: 600;
}

.progress-percent {
    display: inline-block;
    min-width: 40px;
    padding: 4px 8px;
    background: #0284c7;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.progress-bar-outer {
    flex: 1 1 auto;
    height: 8px;
    background: #bae6fd;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7 0%, #0ea5e9 100%);
    transition: width 0.4s ease;
    border-radius: 4px;
}

/* Exercise card states */
.exercise-card {
    position: relative;
    transition: all 0.3s ease;
}

.exercise-card.locked {
    opacity: 0.7;
    border-color: #fecaca !important;
    background-color: #fef2f2 !important;
}

.exercise-card.unlocked {
    border-color: #86efac !important;
}

.exercise-card.completed {
    border-color: #bfdbfe !important;
    background-color: #eff6ff !important;
}

.exercise-card.newly-unlocked {
    animation: pulse-unlock 0.6s ease-out;
    border-color: #fbbf24 !important;
    background: linear-gradient(135deg, #fffaed 0%, #fef3c7 100%) !important;
}

/* Pulse animation for newly unlocked */
@keyframes pulse-unlock {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.4);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 16px rgba(251, 191, 36, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

/* Lock indicator badge */
.exercise-lock-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.lock-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lock-badge.locked {
    background: rgba(239, 68, 68, 0.95);
    color: white;
}

.lock-badge.unlocked {
    background: rgba(34, 197, 94, 0.95);
    color: white;
}

.lock-badge.completed {
    background: rgba(59, 130, 246, 0.95);
    color: white;
}

/* Score badge */
.exercise-score-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

/* Launch button states */
.exercise-card.locked .exercise-launch-btn,
.exercise-card.locked button[type="button"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Toast notifications */
.program-portal-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.program-portal-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    margin: 0;
    font-size: 13px;
}

.toast-content strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.toast-content p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    appearance: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #333;
}

/* Toast variants */
.program-portal-toast-info {
    border-left: 4px solid #3b82f6;
}

.program-portal-toast-warning {
    border-left: 4px solid #f59e0b;
}

.program-portal-toast-success {
    border-left: 4px solid #10b981;
}

.program-portal-toast-error {
    border-left: 4px solid #ef4444;
}

.program-portal-toast-info .toast-content strong {
    color: #1e40af;
}

.program-portal-toast-warning .toast-content strong {
    color: #92400e;
}

.program-portal-toast-success .toast-content strong {
    color: #065f46;
}

.program-portal-toast-error .toast-content strong {
    color: #7f1d1d;
}

/* Locked exercise overlay */
.exercise-card.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    border-radius: inherit;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .program-progress-bar-container {
        margin-bottom: 16px;
        padding: 12px;
    }

    .progress-text {
        font-size: 12px;
    }

    .progress-percent {
        min-width: 36px;
        padding: 3px 6px;
        font-size: 11px;
    }

    .progress-bar-outer {
        height: 6px;
    }

    .exercise-lock-indicator {
        top: 8px;
        right: 8px;
    }

    .lock-badge {
        padding: 4px 8px;
        font-size: 10px;
    }

    .exercise-score-badge {
        width: 40px;
        height: 40px;
        font-size: 11px;
        bottom: 8px;
        right: 8px;
    }

    .program-portal-toast {
        min-width: 280px;
        max-width: 350px;
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .program-progress-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .progress-bar-outer {
        width: 100%;
    }

    .program-portal-toast {
        min-width: calc(100% - 32px);
        right: 16px;
        left: 16px;
    }
}
