/**
 * Program Unlock Popup Styling
 * Congratulations and completion messages
 */

/* Overlay */
.unlock-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unlock-popup-overlay.show {
    opacity: 1;
}

/* Modal */
.unlock-popup-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.unlock-popup-overlay.show .unlock-popup-modal {
    transform: scale(1);
}

/* Header */
.unlock-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.unlock-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.unlock-popup-close {
    appearance: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.unlock-popup-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Body */
.unlock-popup-body {
    padding: 32px 24px;
    text-align: center;
}

/* Score section */
.unlock-popup-score {
    margin-bottom: 32px;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 36px;
    font-weight: 700;
    border-radius: 50%;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(29, 78, 216, 0.25);
}

.score-badge--gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.score-badge--warning {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.score-text {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 600;
}

/* Unlock section */
.unlock-popup-unlock {
    margin: 32px 0;
    padding: 20px;
    background: #ecfdf5;
    border: 2px solid #86efac;
    border-radius: 12px;
}

.unlock-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.unlock-text {
    margin: 0 0 8px;
    font-size: 14px;
    color: #4b5563;
}

.unlock-exercise-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #166534;
    font-family: 'Courier New', monospace;
}

/* Modal variants */
.unlock-popup-modal--success .unlock-popup-unlock {
    background: #fef3c7;
    border-color: #fcd34d;
}

.unlock-popup-modal--success .unlock-exercise-name {
    color: #92400e;
}

.unlock-popup-modal--failure .unlock-popup-unlock {
    display: none;
}

/* Message section */
.unlock-popup-message {
    margin: 24px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.unlock-popup-message p {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.unlock-popup-message p:first-child {
    margin-bottom: 8px;
}

/* Footer */
.unlock-popup-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.unlock-popup-continue {
    appearance: none;
    background: #1d4ed8;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unlock-popup-continue:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.unlock-popup-continue:active {
    transform: translateY(0);
}

/* Locked exercise indicator in portal */
.exercise-card.locked {
    opacity: 0.7;
    pointer-events: none;
}

.exercise-card.locked .exercise-launch-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.exercise-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    z-index: 10;
}

.exercise-lock-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.exercise-lock-status.locked {
    background: #fee2e2;
    color: #991b1b;
}

.exercise-lock-status.unlocked {
    background: #dcfce7;
    color: #166534;
}

.exercise-lock-status.completed {
    background: #dbeafe;
    color: #0c4a6e;
}

/* Progress indicator */
.program-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #0c4a6e;
}

.program-progress-bar {
    flex: 1;
    height: 6px;
    background: #bae6fd;
    border-radius: 3px;
    overflow: hidden;
}

.program-progress-fill {
    height: 100%;
    background: #0284c7;
    transition: width 0.3s ease;
}

.program-progress-text {
    font-weight: 600;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
    .unlock-popup-modal {
        width: 95%;
        max-height: 95vh;
    }

    .unlock-popup-header {
        padding: 16px;
    }

    .unlock-popup-body {
        padding: 20px 16px;
    }

    .score-badge {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }

    .unlock-popup-footer {
        padding: 16px;
    }

    .unlock-popup-continue {
        flex: 1;
    }
}
