/* ==================== JAVA LEVEL TEST STYLES ==================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --junior: #C6DF2B;
    --middle: #f89820;
    --senior: #FF4E99;
    --bg: #faf9f7;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --java-orange: #f89820;
}

/* ==================== MAIN CONTAINER ==================== */
.test-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==================== INTRO SCREEN ==================== */
.intro-screen {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Icon Box - як у React */
.test-icon-box {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 3px solid #fed7aa;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.test-icon-box img {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 10px rgba(248, 152, 32, 0.3));
}

/* Title & Subtitle */
.test-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.test-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ==================== LEVEL CARDS ==================== */
.level-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 35px;
    justify-content: center;
    flex-wrap: wrap;
}

.level-card {
    padding: 24px 32px;
    border-radius: 16px;
    text-align: center;
    min-width: 140px;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.level-card-junior {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.level-card-middle {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
}

.level-card-senior {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-color: #fbcfe8;
}

.level-card-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.level-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.level-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==================== TEST INFO ==================== */
.test-info {
    display: flex;
    gap: 30px;
    margin-bottom: 35px;
    color: var(--text-muted);
    font-size: 1rem;
}

.test-info span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-info i {
    color: var(--java-orange);
}

/* ==================== START BUTTON ==================== */
.start-test-btn {
    background: var(--text);
    color: white;
    padding: 18px 50px;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Rubik', sans-serif;
    transition: all 0.3s ease;
}

.start-test-btn:hover {
    background: #2d2d4a;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.start-test-btn i {
    transition: transform 0.3s ease;
}

.start-test-btn:hover i {
    transform: translateX(5px);
}

/* ==================== QUIZ SCREEN ==================== */
.quiz-screen {
    width: 100%;
    max-width: 700px;
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    background: #e5e7eb;
    border-radius: 20px;
    height: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f89820, #C6DF2B);
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
}

/* ==================== QUESTION CARD ==================== */
.question-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #f89820, #FF9F00);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 30px;
    color: var(--text);
}

.question-code {
    background: #1a1a2e;
    color: #C6DF2B;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.95rem;
    margin-bottom: 25px;
    overflow-x: auto;
    white-space: pre;
}

/* ==================== OPTIONS ==================== */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 18px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
}

.option:hover {
    background: #fff3e0;
    border-color: #f89820;
    transform: translateX(5px);
}

.option.selected {
    background: #fff3e0;
    border-color: #f89820;
}

.option.correct {
    background: #e8f5e9;
    border-color: #4caf50;
}

.option.wrong {
    background: #ffebee;
    border-color: #f44336;
}

/* ==================== BUTTONS ==================== */
.btn-container {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn {
    padding: 16px 40px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Rubik', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #f89820, #FF9F00);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(248, 152, 32, 0.4);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== LOADER SCREEN ==================== */
.loader-screen {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.loader-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
    position: relative;
}

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: #f89820;
    animation: spin 1s linear infinite;
}

.loader-circle:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #C6DF2B;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

.loader-circle:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #5382a1;
    animation-duration: 0.6s;
}

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

.loader-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.loader-subtext {
    color: var(--text-muted);
    font-size: 1rem;
}

.analyzing-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ==================== RESULT SCREEN ==================== */
.result-screen {
    display: none;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
}

.result-badge {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 5rem;
    animation: badgePop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result-badge.junior { background: linear-gradient(135deg, #C6DF2B, #a8c41f); }
.result-badge.middle { background: linear-gradient(135deg, #f89820, #e07c00); }
.result-badge.senior { background: linear-gradient(135deg, #FF4E99, #e0357a); }

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-level {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.result-level.junior { color: var(--junior); }
.result-level.middle { color: var(--middle); }
.result-level.senior { color: var(--senior); }

.result-score {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.result-description {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-description h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text);
}

.result-description p {
    color: var(--text-muted);
    line-height: 1.7;
}

.result-path-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 50px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.result-path-btn.junior { background: linear-gradient(135deg, #C6DF2B, #a8c41f); color: #1a1a2e; }
.result-path-btn.middle { background: linear-gradient(135deg, #f89820, #e07c00); }
.result-path-btn.senior { background: linear-gradient(135deg, #FF4E99, #e0357a); }

.result-path-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* ==================== CONFETTI ==================== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
}

@keyframes confettiFall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==================== LOGIN WARNING ==================== */
.login-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #e65100;
    width: 100%;
    max-width: 600px;
}

.login-warning i {
    font-size: 1.2rem;
}

.login-warning a {
    margin-left: auto;
    background: #ff9800;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-warning a:hover {
    background: #f57c00;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .test-main {
        padding: 30px 15px;
    }

    .test-title {
        font-size: 2rem;
    }

    .test-subtitle {
        font-size: 1rem;
    }

    .level-cards {
        flex-direction: row;
        justify-content: center;
    }

    .level-card {
        padding: 20px 24px;
        min-width: 100px;
    }

    .level-card h3 {
        font-size: 1rem;
    }

    .level-card p {
        font-size: 0.8rem;
    }

    .test-info {
        gap: 20px;
        font-size: 0.9rem;
    }

    .start-test-btn {
        padding: 16px 40px;
        font-size: 1rem;
    }

    .question-card {
        padding: 25px;
    }

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

    .result-level {
        font-size: 2.2rem;
    }

    .result-badge {
        width: 140px;
        height: 140px;
        font-size: 4rem;
    }

    .btn {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .level-cards {
        gap: 10px;
    }

    .level-card {
        padding: 16px 18px;
        min-width: 90px;
    }

    .level-card-icon {
        font-size: 1.8rem;
    }

    .test-icon-box {
        width: 100px;
        height: 100px;
    }

    .test-icon-box img {
        width: 55px;
        height: 55px;
    }
}

/* ==================== UTILITY ==================== */
.hidden { display: none !important; }