/* Deep Dive Mastery Lab Styles */

.deep-dive-lab {
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.deep-dive-header {
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
}

.deep-dive-header h2 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.deep-dive-header p {
    font-size: 1.1rem;
    color: #4a5568;
    margin: 0;
}

/* Scoreboard */
.deep-dive-scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-card,
.progress-card {
    padding: 1.5rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.score-label,
.progress-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.progress-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.calculator-modes {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.mode-btn:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

/* Level Menu */
.deep-dive-menu {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.deep-dive-menu h3 {
    margin-top: 0;
    color: #1a202c;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.level-btn {
    padding: 1.5rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
}

.level-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.level-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.level-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.level-btn.active .level-number {
    color: white;
}

.level-title {
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.level-btn.active .level-title {
    color: white;
}

.level-difficulty {
    font-size: 0.8rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-btn.active .level-difficulty {
    color: rgba(255, 255, 255, 0.8);
}

/* Challenge Card */
.challenge-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.challenge-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.challenge-level-tag {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.challenge-content {
    padding: 2rem;
}

/* Challenge Sections */
.problem-section,
.steps-section,
.calculator-section,
.answer-section,
.explanation-section,
.tip-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.problem-section:last-of-type,
.steps-section:last-of-type,
.calculator-section:last-of-type,
.answer-section:last-of-type,
.explanation-section:last-of-type,
.tip-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.challenge-content h4 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.problem-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #4a5568;
    background: #f7fafc;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.steps-list {
    padding-left: 2rem;
    color: #4a5568;
    line-height: 1.8;
}

.steps-list li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.steps-list li::marker {
    color: #667eea;
    font-weight: 700;
}

.deep-dive-calculator {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.deep-dive-calculator iframe {
    width: 100% !important;
    height: 450px !important;
    border: none !important;
}

.answer-box {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 1.5rem;
    border-radius: 4px;
    color: #166534;
    font-weight: 600;
    font-size: 1.05rem;
}

.explanation-text {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1rem;
}

.tip-section {
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #fcd34d;
}

.tip-section h4 {
    color: #92400e;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.tip-text {
    color: #78350f;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* Challenge Navigation */
.challenge-navigation {
    padding: 2rem;
    background: #f7fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    flex: 0 1 auto;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .deep-dive-lab {
        padding: 1rem;
    }

    .deep-dive-header h2 {
        font-size: 1.8rem;
    }

    .deep-dive-scoreboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .challenge-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .challenge-content {
        padding: 1.5rem;
    }

    .challenge-navigation {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        min-width: 0;
    }

    .deep-dive-calculator iframe {
        height: 350px !important;
    }
}

@media (max-width: 480px) {
    .deep-dive-lab {
        padding: 0.75rem;
    }

    .deep-dive-header h2 {
        font-size: 1.5rem;
    }

    .challenge-header h3 {
        font-size: 1.2rem;
    }

    .levels-grid {
        grid-template-columns: 1fr;
    }

    .deep-dive-calculator iframe {
        height: 300px !important;
    }

    .challenge-navigation {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.challenge-card {
    animation: slideIn 0.5s ease;
}

/* Print Styles */
@media print {
    .deep-dive-lab {
        background: white;
        box-shadow: none;
    }

    .deep-dive-scoreboard,
    .challenge-navigation {
        display: none;
    }

    .challenge-card {
        break-inside: avoid;
    }
}
