@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.75);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --correct-color: #22c55e;
    --wrong-color: #ef4444;
}

body {
    margin: 0;
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.2) 0px, transparent 50%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 850px;
}

.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.glass-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}

.question-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
    white-space: pre-wrap;
    word-break: keep-all;
}

.code-block {
    background: #1e1e1e;
    color: #e4e4e4;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.05rem;
    overflow-x: auto;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.5;
    white-space: pre-wrap; /* NEW: Fixes linebreaks in code */
}

/* Add styles for standard mock exam selector */
.exam-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.exam-selector::-webkit-scrollbar {
    width: 8px;
}
.exam-selector::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}
.exam-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--accent-color);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s;
    min-width: 100px;
}
.exam-btn:hover, .exam-btn.active {
    background: var(--accent-color);
    color: #0f172a;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-family: 'Pretendard', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.check-answer-btn {
    background: transparent;
    border: 2px solid #8b5cf6;
    color: #c4b5fd;
    padding: 0 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.check-answer-btn:hover {
    background: #8b5cf6;
    color: white;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

.submit-btn {
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
}

.submit-all-btn {
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    color: white;
    box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.8);
}
.submit-all-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.5s ease;
}

.feedback.correct {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--correct-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback.wrong {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--wrong-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.answer-explanation {
    margin-top: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #e2e8f0;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
}

.score-panel {
    text-align: center;
    display: none;
}
.score-panel h2 {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    color: white;
}
#score-text {
    background: linear-gradient(to right, #22c55e, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
