/* Python Challenge Specific Styles - Cyberpunk Purple Theme */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 20%, #5b21b6 40%, #4c1d95 60%, #2d1b4e 80%, #1a0f2e 90%, #0f0820 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 30px 0;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.8),
                 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-icon {
    width: 120px;
    height: 120px;
    border: 3px solid #7c3aed;
    padding: 8px;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.8),
                0 0 40px rgba(124, 58, 237, 0.6),
                inset 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Main Content */
main {
    flex: 1;
}

.quiz-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Quiz Start Screen */
.quiz-start {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    text-align: center;
}

.quiz-start h2 {
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 20px;
    font-weight: 700;
}

.quiz-description {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 40px;
    line-height: 1.8;
}

.start-btn {
    background: #7c3aed;
    color: white;
    border: 2px solid #7c3aed;
    padding: 16px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background: white;
    color: #7c3aed;
    transform: translateY(-2px);
}

/* Quiz Container */
.quiz-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #7c3aed;
}

.question-counter,
.score-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.question-counter span,
.score-display span {
    color: #7c3aed;
}

/* Question Section */
.question-section {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
    line-height: 1.6;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 20px;
    text-align: left;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-btn:hover:not(.correct):not(.incorrect):not(.disabled) {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.05);
}

.answer-btn.correct {
    background: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
    color: #16a34a;
    font-weight: 600;
}

.answer-btn.incorrect {
    background: rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
    color: #dc2626;
}

.answer-btn.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Next Button */
.next-btn {
    background: #7c3aed;
    color: white;
    border: 2px solid #7c3aed;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.next-btn:hover {
    background: white;
    color: #7c3aed;
}

/* Results Container */
.results-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    text-align: center;
}

.results-container h2 {
    font-size: 2rem;
    color: #7c3aed;
    margin-bottom: 30px;
    font-weight: 700;
}

.final-score {
    margin-bottom: 30px;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: #7c3aed;
    line-height: 1;
    margin-bottom: 10px;
}

.score-percentage {
    font-size: 2rem;
    color: #333;
    font-weight: 600;
}

/* Level Badge */
.level-badge {
    background: rgba(124, 58, 237, 0.1);
    border: 2px solid #7c3aed;
    padding: 30px;
    margin-bottom: 40px;
}

.level-badge h3 {
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.level-badge p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.retake-btn {
    background: #7c3aed;
    color: white;
    border: 2px solid #7c3aed;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retake-btn:hover {
    background: white;
    color: #7c3aed;
}

.home-link {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    color: #7c3aed;
    text-decoration: none;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.home-link:hover {
    background: #7c3aed;
    color: white;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

/* Certificate Section */
.certificate-section {
    margin: 30px 0;
    padding: 25px;
    background: rgba(124, 58, 237, 0.1);
    border: 2px solid #7c3aed;
    border-radius: 12px;
}

.certificate-section h3 {
    color: #7c3aed;
    margin-bottom: 20px;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.name-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    margin-bottom: 15px;
    font-size: 18px;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    background: white;
    color: #333;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    border-color: #9f67ff;
}

.generate-cert-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #7c3aed, #9f67ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.generate-cert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.6);
}

.generate-cert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.certificate-container {
    margin-top: 25px;
    text-align: center;
}

#certificateCanvas {
    max-width: 100%;
    height: auto;
    border: 3px solid #7c3aed;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
    margin-bottom: 20px;
}

.download-cert-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-cert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.6);
}

/* Footer */
footer {
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
}

.copyright {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .quiz-start,
    .quiz-container,
    .results-container {
        padding: 30px 15px;
    }

    .quiz-start h2 {
        font-size: 2rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .score-number {
        font-size: 3rem;
    }

    .level-badge h3 {
        font-size: 2rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .retake-btn,
    .home-link {
        width: 100%;
    }

    .logo-icon {
        width: 90px;
        height: 90px;
    }
}
