/* 세무인사이드 - 깔끔하고 직관적인 디자인 */
:root {
    /* 메인 컬러 */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* 보조 컬러 */
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 배경 */
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-dark: #1e293b;
    
    /* 텍스트 */
    --text-dark: #0f172a;
    --text-gray: #475569;
    --text-light: #64748b;
    --text-white: #ffffff;
    
    /* 테두리 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 그림자 */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header h1::before {
    content: '📊';
    font-size: 1.5rem;
}

header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

header nav a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

header nav a:hover {
    color: var(--primary);
    background: var(--bg-gray);
}

header nav span {
    color: var(--text-gray);
    font-weight: 500;
}

/* 로그인/회원가입 링크 숨김 */
header nav a[href*="login"],
header nav a[href*="register"] {
    display: none;
}

/* 메인 콘텐츠 */
main {
    min-height: calc(100vh - 200px);
}

section {
    padding: 3rem 0;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2rem;
}

/* 히어로 섹션 */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 기능 섹션 */
.features-section {
    background: var(--bg-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* 시험 목록 */
.exam-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.exam-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.exam-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.exam-card.completed {
    border-color: var(--success);
    background: #f0fdf4;
}

.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.completed-text {
    background: var(--success);
    color: var(--text-white);
}

.pending-text {
    background: var(--warning);
    color: var(--text-white);
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-width: 100px;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--primary-light);
    color: var(--text-white);
}

.btn-info:hover {
    background: var(--primary);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: 80px;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* 폼 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: var(--bg-white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 알림 */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--danger);
}

/* 시험 컨테이너 */
.exam-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.exam-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.question-card {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.option:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.option input[type="radio"] {
    margin-right: 0.75rem;
}

.option-text {
    font-size: 1rem;
}

/* 결과 페이지 */
.result-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.score-summary {
    text-align: center;
    margin-bottom: 2rem;
}

.score-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white);
    padding: 2rem;
    border-radius: 1rem;
    display: inline-block;
}

.score {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.question-review {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--border);
}

.question-review.correct {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.question-review.incorrect {
    border-left-color: var(--danger);
    background: #fef2f2;
}

.options-review {
    margin: 1rem 0;
}

.options-review .option {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.options-review .option.selected {
    background: #dbeafe;
    border-color: var(--primary);
}

.options-review .option.correct {
    background: #d1fae5;
    border-color: var(--success);
}

/* 관리자 페이지 */
.admin-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

/* 관리자 폼 스타일 */
.exam-form {
    max-width: 1000px;
    margin: 0 auto;
}

.exam-info {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.questions-section {
    margin-bottom: 2rem;
}

.questions-section h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.question-form {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-form h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.options-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* 알림 스타일 추가 */
.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: var(--primary);
}

/* 인증 링크 */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* 정보 메시지 */
.info-message {
    background: var(--bg-gray);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    color: var(--text-gray);
    border: 1px solid var(--border);
}

/* 정답 설명 스타일 */
.explanation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

.explanation h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.explanation p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.exam-selector {
    margin-bottom: 2rem;
}

.exam-selector select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.stats-summary {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0.5rem 0;
}

/* 테이블 */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--primary);
    color: var(--text-white);
    font-weight: 500;
}

tr:hover {
    background: var(--bg-gray);
}

.score {
    font-weight: bold;
    color: var(--primary);
}

/* 대시보드 */
.dashboard {
    padding: 2rem 0;
}

.welcome {
    text-align: center;
    padding: 3rem 0;
}

.welcome-actions {
    margin-top: 2rem;
}

.no-content {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.1rem;
    padding: 2rem;
}

.no-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.no-content a:hover {
    text-decoration: underline;
}



/* 푸터 */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-gray);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    header nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 모바일에서도 로그인/회원가입 링크 숨김 */
    header nav a[href*="login"],
    header nav a[href*="register"] {
        display: none;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .exam-list {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    

    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
    
    .welcome-actions .btn {
        width: auto;
        min-width: 250px;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}
