/* Adobe Fonts import */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: electrical-safety, "Noto Serif KR", "Arial Unicode MS", "Segoe UI", sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4aa;
}

.logo-highlight {
    display: inline-block;
    padding: 0px 2px;
    border: 3px solid #FF7EB3;
    margin-right: 2px;
    line-height: 1.2;
}

.logo-underline {
    border-bottom: 3px solid #FF7EB3;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    margin-left: 2rem;
    font-family: "Asta Sans", sans-serif;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00d4aa;
}







/* Hero Section */
.hero {
    background: #282A35;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: #FFF4A3;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.hero-main-text {
    font-size: 1.4rem !important;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #cccccc;
}

#totalProblems {
    color: #E6665A !important;
}

#totalSubjects {
    color: #5EA85D !important;
}

#latestUpdate {
    color: #457BF2 !important;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #cccccc;
}

/* Subjects Section */
.subjects {
    padding: 4rem 0;
}

.subjects h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.subject-card {
    position: relative;
    background: white;
    border: 1px solid #000;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15), 0 0 20px rgba(255, 126, 179, 0.3);
    border-color: #FF7EB3;
    border-width: 2px;
}

.card-cover {
    padding: 0;
    text-align: left;
    position: relative;
}

.card-header {
    background: #00d4aa;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid #000;
    border-radius: 8px 8px 0 0;
}

.card-header span {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.card-content {
    padding: 1.5rem;
}



.card-cover h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #000;
    font-weight: 700;
    line-height: 1.3;
}

.card-cover p {
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-size: 0.95rem;
}

.card-stats {
    border-top: 1px dotted #ccc;
    padding-top: 0.8rem;
    margin-top: 0.8rem;
}

.card-stats span {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}



/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    font-family: "Asta Sans", sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* 네비게이션 컨테이너 패딩 줄이기 */
    .nav-container {
        padding: 0 15px;
    }
    
    /* 로고 크기 조정 */
    .logo {
        font-size: 1.2rem;
    }
    
    /* 네비게이션 링크 간격 줄이기 */
    .nav-links a {
        margin-left: 1rem;
        font-size: 0.9rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .subject-grid {
        grid-template-columns: 1fr;
    }
}

/* 더 작은 휴대폰 화면 (480px 이하) */
@media (max-width: 480px) {
    /* 네비게이션 패딩 더 줄이기 */
    .nav-container {
        padding: 0 10px;
    }
    
    /* 로고 더 작게 */
    .logo {
        font-size: 1rem;
    }
    
    /* 로고 하이라이트 요소 조정 */
    .logo-highlight {
        padding: 0px 1px;
        border: 2px solid #FF7EB3;
        margin-right: 1px;
    }
    
    .logo-underline {
        border-bottom: 2px solid #FF7EB3;
    }
    
    /* 네비게이션 링크 더 작게 */
    .nav-links a {
        margin-left: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* 네비게이션 패딩 줄이기 */
    nav {
        padding: 0.7rem 0;
    }
    
    /* 히어로 섹션 조정 */
    .hero-content h1 {
        font-size: 1.7rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-main-text {
        font-size: 1.1rem !important;
    }
    
    .hero-stats {
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .stat {
        min-width: 70px;
        max-width: 100px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* 문제풀이 페이지 조정 */
    .problem-container {
        margin: 1rem auto;
        padding: 1rem;
    }
    
    .problem-question {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    /* 모바일에서 문제 정보 행 조정 */
    .problem-info-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .difficulty-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    /* 휴대폰에서 문제 본문 코드 블럭 최적화 */
    .problem-question code {
        font-size: 12px !important;
        line-height: 1.4;
    }
    
    .problem-question pre {
        padding: 10px;
        margin: 3px 0 3px 0;
        overflow-x: auto;
        font-size: 12px;
        word-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
    }
    
    .problem-question code:not(pre code) {
        font-size: 0.8em !important;
        padding: 2px 4px;
    }
    
    .option {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    /* 해설의 코드 블럭 크기 조정 */
    .explanation code {
        font-size: 12px !important;
        line-height: 1.4;
    }
    
    .explanation pre {
        padding: 10px;
        margin: 3px 0 3px 0;
        overflow-x: auto;
        font-size: 12px;
        word-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
    }
    
    .explanation code:not(pre code) {
        font-size: 0.8em !important;
        padding: 2px 4px;
    }
    
    .submit-btn {
        font-size: 1.1rem;
        padding: 0.8rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-btn {
        width: 100%;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Problem Page Styles */
.problem-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.problem-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.problem-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Noto Serif KR", serif;
    font-optical-sizing: auto;
    font-style: normal;
}

.difficulty-easy {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.difficulty-medium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.problem-question {
    font-family: "Noto Serif KR", serif;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: 400;
    font-optical-sizing: auto;
    font-style: normal;
    white-space: pre-wrap;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: "Noto Serif KR", serif;
    font-weight: 400;
    font-optical-sizing: auto;
    font-style: normal;
}

.option {
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-family: "Noto Serif KR", serif;
    font-weight: 400;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.6;
}

.option:hover {
    border-color: #00d4aa;
    background: #f0f8ff;
}

.option.selected {
    border-color: #00d4aa;
    background: #f0f8ff;
    color: #333;
}

.option.correct {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

/* .option.incorrect 스타일은 JavaScript에서 직접 적용하므로 제거 */

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #00d4aa;
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    font-family: electrical-safety, sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #00b894;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.explanation {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0f8ff;
    border-radius: 10px;
    border-left: 4px solid #00d4aa;
    font-family: "Noto Serif KR", serif;
    font-weight: 400;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 문제 풀이 결과 메시지 스타일 */
#resultMessage {
    font-family: "Noto Serif KR", serif !important;
    font-weight: 500;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.4;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: left;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.nav-btn {
    padding: 1rem 2rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: "Asta Sans", sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease;
}

.nav-btn:hover {
    background: #4b5563;
}

.nav-btn.primary {
    background: #00d4aa;
    color: #1a1a1a;
    font-family: "Asta Sans", sans-serif;
    font-weight: 500;
}

.nav-btn.primary:hover {
    background: #00b894;
    transform: translateY(-1px);
}

/* Dashboard Styles */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #00d4aa;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #666;
    font-weight: 500;
}

.progress-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.progress-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa 0%, #00b894 100%);
    transition: width 0.3s ease;
}

.wrong-answers {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.wrong-answer-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wrong-answer-item:hover {
    background: #f9fafb;
}

.retry-btn {
    padding: 0.5rem 1rem;
    background: #00d4aa;
    color: #1a1a1a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #00b894;
    transform: translateY(-1px);
}

/* Form Styles */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00d4aa;
}

.form-btn {
    width: 100%;
    padding: 1rem;
    background: #00d4aa;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-btn:hover {
    background: #00b894;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

/* 버튼 툴팁 스타일 */


.form-link {
    text-align: center;
    margin-top: 1rem;
}

.form-link a {
    color: #00d4aa;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #cfc;
}

/* Google 로그인 버튼 스타일 */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.google-btn {
    width: 100%;
    padding: 0.75rem;
    background: white;
    color: #333;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* 코드 블록 스타일 - 밝은 테마로 변경 */
.problem-question pre,
.option pre {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 4px 0 4px 0;
    overflow-x: auto;
    border: 1px solid #e9ecef;
    color: #333;
}

/* 해설 코드 블록은 밝은 테마 */
.explanation pre {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 4px 0 4px 0;
    overflow-x: auto;
    border: 1px solid #e9ecef;
    color: #333;
}

/* 문제 텍스트 내 코드 블럭 - 폰트 사이즈 축소 */
.problem-question code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 12px;
    line-height: 1.4;
    font-variant-numeric: normal !important;
    font-feature-settings: normal !important;
    -webkit-font-feature-settings: normal !important;
    -moz-font-feature-settings: normal !important;
}

/* 선지의 코드 블럭 - 어두운 테마 */
.option code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px;
    line-height: 1.4;
    font-variant-numeric: normal !important;
    font-feature-settings: normal !important;
    -webkit-font-feature-settings: normal !important;
    -moz-font-feature-settings: normal !important;
}

/* 해설의 코드 블럭 - 밝은 테마 */
.explanation code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 14px;
    line-height: 1.4;
    color: #333 !important;
    font-variant-numeric: normal !important;
    font-feature-settings: normal !important;
    -webkit-font-feature-settings: normal !important;
    -moz-font-feature-settings: normal !important;
}

/* Prism.js 테마 커스터마이징 - 문제와 선지 (밝은 테마) */
.problem-question .token,
.option .token {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 문제와 선택지의 Prism.js 토큰 - 밝은 테마 색상 */
.problem-question .token.comment,
.problem-question .token.prolog,
.problem-question .token.doctype,
.problem-question .token.cdata,
.option .token.comment,
.option .token.prolog,
.option .token.doctype,
.option .token.cdata {
    color: #708090 !important;
}

.problem-question .token.punctuation,
.option .token.punctuation {
    color: #999 !important;
}

.problem-question .token.property,
.problem-question .token.tag,
.problem-question .token.boolean,
.problem-question .token.number,
.problem-question .token.constant,
.problem-question .token.symbol,
.problem-question .token.deleted,
.option .token.property,
.option .token.tag,
.option .token.boolean,
.option .token.number,
.option .token.constant,
.option .token.symbol,
.option .token.deleted {
    color: #d73a49 !important;
}

.problem-question .token.selector,
.problem-question .token.attr-name,
.problem-question .token.string,
.problem-question .token.char,
.problem-question .token.builtin,
.problem-question .token.inserted,
.option .token.selector,
.option .token.attr-name,
.option .token.string,
.option .token.char,
.option .token.builtin,
.option .token.inserted {
    color: #22863a !important;
}

.problem-question .token.operator,
.problem-question .token.entity,
.problem-question .token.url,
.problem-question .language-css .token.string,
.problem-question .style .token.string,
.option .token.operator,
.option .token.entity,
.option .token.url,
.option .language-css .token.string,
.option .style .token.string {
    color: #6f42c1 !important;
}

.problem-question .token.atrule,
.problem-question .token.attr-value,
.problem-question .token.keyword,
.option .token.atrule,
.option .token.attr-value,
.option .token.keyword {
    color: #005cc5 !important;
}

.problem-question .token.function,
.option .token.function {
    color: #e36209 !important;
}

.problem-question .token.regex,
.problem-question .token.important,
.problem-question .token.variable,
.option .token.regex,
.option .token.important,
.option .token.variable {
    color: #d73a49 !important;
}

/* 해설의 Prism.js 토큰 - 밝은 테마 색상 */
.explanation .token.comment,
.explanation .token.prolog,
.explanation .token.doctype,
.explanation .token.cdata {
    color: #708090 !important;
}

.explanation .token.punctuation {
    color: #999 !important;
}

.explanation .token.property,
.explanation .token.tag,
.explanation .token.boolean,
.explanation .token.number,
.explanation .token.constant,
.explanation .token.symbol,
.explanation .token.deleted {
    color: #d73a49 !important;
}

.explanation .token.selector,
.explanation .token.attr-name,
.explanation .token.string,
.explanation .token.char,
.explanation .token.builtin,
.explanation .token.inserted {
    color: #22863a !important;
}

.explanation .token.operator,
.explanation .token.entity,
.explanation .token.url,
.explanation .language-css .token.string,
.explanation .style .token.string {
    color: #6f42c1 !important;
}

.explanation .token.atrule,
.explanation .token.attr-value,
.explanation .token.keyword {
    color: #005cc5 !important;
}

.explanation .token.function {
    color: #e36209 !important;
}

.explanation .token.regex,
.explanation .token.important,
.explanation .token.variable {
    color: #d73a49 !important;
}

/* 문제 텍스트 내 인라인 코드 스타일 - 작은 폰트 */
.problem-question code:not(pre code) {
    background: #ECECEC;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 선지 내 인라인 코드 스타일 - 어두운 테마에 맞게 */
.option code:not(pre code) {
    background: #ECECEC;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 해설 내 인라인 코드 스타일 - 밝은 테마에 맞게 */
.explanation code:not(pre code) {
    background: #f1f3f4;
    color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #d0d7de;
    box-shadow: none;
}

/* 틀린 문제 페이지 스타일 - 밝은 테마 */
.wrong-problems-list {
    margin-top: 20px;
}

.wrong-problems-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.wrong-problems-header h3 {
    margin: 0;
    color: #333;
    font-family: "Noto Serif KR", serif;
}

.wrong-problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.wrong-problem-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wrong-problem-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-color: #00d4aa;
}

.problem-preview h4 {
    margin: 0 0 10px 0;
    color: #00d4aa;
    font-family: "Noto Serif KR", serif;
    font-weight: 600;
}

.problem-preview p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
    font-family: "Noto Serif KR", serif;
}

.answer-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wrong-answer {
    color: #dc3545;
    font-weight: bold;
}

.correct-answer {
    color: #28a745;
    font-weight: bold;
}

.retry-note {
    color: #00d4aa;
    font-weight: bold;
    font-style: italic;
    font-family: "Noto Serif KR", serif;
}

/* 틀린문제 페이지 버튼 스타일 */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: "Noto Serif KR", serif;
}

.btn-primary {
    background: #00d4aa;
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #00b894;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.no-wrong-problems {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.no-wrong-problems h3 {
    color: #00d4aa;
    margin-bottom: 10px;
    font-family: "Noto Serif KR", serif;
    font-weight: 600;
}

.no-wrong-problems p {
    color: #666;
    margin-bottom: 20px;
    font-family: "Noto Serif KR", serif;
}

.completion-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.completion-message h3 {
    color: #00d4aa;
    margin-bottom: 10px;
    font-family: "Noto Serif KR", serif;
    font-weight: 600;
}

.completion-message p {
    color: #666;
    margin-bottom: 20px;
    font-family: "Noto Serif KR", serif;
}

/* 틀린 문제 풀기 시 답안 표시 */
.option.wrong-answer {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
}

.option.correct-answer {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}

/* 틀린 문제 풀이 페이지 답안 체크 후 스타일 (일반 문제 풀이와 동일) */
.option.wrong-selected {
    border-color: #FF7EB3 !important;
    background-color: #fff0f5 !important;
    color: #333 !important;
}

.option.correct-answer-show {
    border-color: #00d4aa !important;
    background-color: #f0f8ff !important;
    color: #333 !important;
}

/* 내 정보 페이지 스타일 */
.profile-layout {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

/* 사이드바 스타일 */
.profile-sidebar {
    width: 280px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.sidebar-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-item:hover {
    background: #f8f9fa;
    color: #00d4aa;
    transform: translateX(5px);
}

.sidebar-item.active {
    background: #00d4aa;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.sidebar-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* 메인 콘텐츠 영역 */
.profile-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.section-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

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

.info-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    display: block;
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 메시지 스타일 */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 위험 구역 스타일 */
.danger-zone {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.danger-zone h4 {
    color: #c53030;
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: #744210;
    margin-bottom: 1rem;
}

.danger-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-content h3 {
    color: #c53030;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.modal-actions .form-btn {
    flex: 1;
    max-width: 150px;
}

.modal-actions .danger-btn {
    flex: 1;
    max-width: 150px;
}

/* 네비게이션 활성 상태 */
.nav-links a.active {
    color: #00d4aa;
    font-weight: 600;
}

/* 대시보드 스타일 */
.dashboard-content {
    margin-top: 1rem;
}

.overall-stats, .subjects-progress {
    margin-bottom: 2rem;
}

.overall-stats h3, .subjects-progress h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #00d4aa;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9rem;
}

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

.subject-progress-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.subject-header h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.subject-header p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.subject-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #00d4aa;
    color: white;
}

.btn-secondary {
    background: white;
    color: #333;
    border: 1px solid #e5e7eb;
}

.btn-primary:hover {
    background: #00b894;
    transform: translateY(-1px);
}

.btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* 반응형 디자인 - 프로필 페이지 */
@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
        margin: 1rem;
        gap: 1rem;
    }
    
    .profile-sidebar {
        width: 100%;
        position: static;
        order: 2;
    }
    
    .profile-content {
        order: 1;
        padding: 1.5rem;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .sidebar-item {
        white-space: nowrap;
        min-width: 120px;
        justify-content: center;
        font-size: 0.85rem;
    }
    
    .sidebar-item:hover {
        transform: translateY(-2px);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
}

/* 관리자 페이지 반응형 디자인 */
@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }
    
    .admin-header {
        padding: 15px;
        text-align: center;
    }
    
    .admin-header h1 {
        font-size: 1.3rem;
    }
    
    .admin-header p {
        font-size: 0.9rem;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-tab {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    

    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.9rem;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .problem-item {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .problem-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .problem-actions button {
        flex: 1;
        font-size: 0.85rem;
    }
}

/* 아주 작은 화면 (320px 이하) */
@media (max-width: 320px) {
    /* 로고 최소 크기 */
    .logo {
        font-size: 0.9rem;
    }
    
    /* 네비게이션 링크 최소 크기 */
    .nav-links a {
        margin-left: 0.3rem;
        font-size: 0.75rem;
    }
    
    /* 네비게이션 컨테이너 최소 패딩 */
    .nav-container {
        padding: 0 8px;
    }
    
    /* 문제풀이 페이지 최소 크기 */
    .problem-container {
        padding: 0.8rem;
    }
    
    .problem-question {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    /* 매우 작은 화면에서 문제 본문 코드 블럭 최적화 */
    .problem-question code {
        font-size: 11px !important;
        line-height: 1.3;
    }
    
    .problem-question pre {
        padding: 8px;
        margin: 3px 0 3px 0;
        font-size: 11px;
        word-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .problem-question code:not(pre code) {
        font-size: 0.75em !important;
        padding: 2px 3px;
    }
    
    .option {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* 매우 작은 화면에서 해설 코드 블럭 최적화 */
    .explanation code {
        font-size: 11px !important;
        line-height: 1.3;
    }
    
    .explanation pre {
        padding: 8px;
        margin: 3px 0 3px 0;
        font-size: 11px;
        word-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .explanation code:not(pre code) {
        font-size: 0.75em !important;
        padding: 2px 3px;
    }
    
    /* 관리자 페이지 최소 크기 */
    .admin-container {
        padding: 10px;
    }
    
    .admin-header h1 {
        font-size: 1.1rem;
    }
    
    .admin-tab {
        font-size: 0.8rem;
        padding: 10px 15px;
    }
    
    .problem-form {
        padding: 15px;
    }
}

/* 빈 상태 스타일 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.empty-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-state p {
    color: #999;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.empty-state .btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #00d4aa;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.empty-state .btn-primary:hover {
    background: #00b894;
}