/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --success-color: #52c41a;
    --error-color: #ff4d4f;
    --warning-color: #faad14;
    --bg-dark: #1f2937;
    --bg-light: #f5f5f5;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* GNB (Global Navigation Bar) */
.gnb {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    border-bottom: 2px solid var(--border-color);
}

.gnb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.gnb-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.gnb-logo:hover {
    color: #357abd;
}

.gnb-menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gnb-item {
    padding: 8px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.gnb-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.gnb-item.active {
    background: var(--primary-color);
    color: white;
}

.gnb-item.active:hover {
    background: #357abd;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 메인 페이지 스타일 */
.main-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #357abd 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
}

.main-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    padding: 20px 0;
}

.tool-section {
    margin-bottom: 40px;
}

.tool-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d48806 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(250, 173, 20, 0.4);
}

.tool-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.tool-card p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.exam-selection h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.selection-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.option-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.option-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.option-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.option-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.round-buttons,
.subject-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-round,
.btn-subject {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 44px;
    line-height: 1.4;
}

.subject-weight {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.btn-round:hover,
.btn-subject:hover {
    background: #357abd;
    transform: scale(1.05);
}

.btn-round:active,
.btn-subject:active {
    transform: scale(0.98);
}

/* 시험 진행 페이지 스타일 */
.exam-header {
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    color: white;
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.timer-section,
.progress-section {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.timer-icon,
.progress-icon {
    font-size: 1.3rem;
}

.btn-end-exam {
    padding: 10px 20px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
}

.btn-end-exam:hover {
    background: #d32f2f;
}

.exam-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.question-wrapper {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.question-number {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    padding: 15px 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: #e8f4fd;
}

.option-item.selected {
    border-color: var(--primary-color);
    background: #e8f4fd;
    font-weight: 600;
}

.option-item.correct {
    border-color: var(--success-color);
    background: #f6ffed;
    color: var(--success-color);
}

.option-item.incorrect {
    border-color: var(--error-color);
    background: #fff1f0;
    color: var(--error-color);
}

.option-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-weight: 600;
    flex-shrink: 0;
}

.option-item.selected .option-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.option-item.correct .option-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.option-item.incorrect .option-number {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.answer-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.answer-result {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.1rem;
}

.answer-result.correct {
    background: #f6ffed;
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.answer-result.incorrect {
    background: #fff1f0;
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.explanation {
    padding: 20px;
    background: #f9fafb;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    line-height: 1.8;
}

.explanation strong {
    color: var(--primary-color);
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn-nav {
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
    flex: 1;
}

.btn-nav:hover:not(:disabled) {
    background: #357abd;
}

.btn-nav:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* 결과 페이지 스타일 */
.result-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #357abd 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
}

.result-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.summary-card h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.summary-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card.correct .summary-number {
    color: var(--success-color);
}

.summary-card.incorrect .summary-number {
    color: var(--error-color);
}

.summary-card.score .summary-number {
    color: var(--primary-color);
}

.pass-status {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 40px;
}

.pass-status.pass {
    border: 3px solid var(--success-color);
    background: #f6ffed;
}

.pass-status.fail {
    border: 3px solid var(--error-color);
    background: #fff1f0;
}

.pass-status h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pass-status.pass h2 {
    color: var(--success-color);
}

.pass-status.fail h2 {
    color: var(--error-color);
}

.wrong-answers-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.wrong-answers-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-filter {
    padding: 10px 20px;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-filter:hover {
    border-color: var(--primary-color);
}

.btn-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.wrong-answers-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wrong-answer-item {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--error-color);
}

.wrong-answer-item h3 {
    color: var(--error-color);
    margin-bottom: 10px;
}

.result-actions {
    text-align: center;
    margin-top: 40px;
}

.btn-primary {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
}

.btn-primary:hover {
    background: #357abd;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .gnb-container {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
    }

    .gnb-logo {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .gnb-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .gnb-item {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .selection-options {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .timer-section,
    .progress-section {
        justify-content: center;
    }

    .btn-end-exam {
        width: 100%;
    }

    .question-wrapper {
        padding: 20px;
    }

    .result-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .main-header {
        padding: 30px 15px;
    }

    .main-header h1 {
        font-size: 1.5rem;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }
}

/* 접근성 개선 */
.option-item:focus,
.btn-round:focus,
.btn-subject:focus,
.btn-nav:focus,
.btn-filter:focus,
.btn-primary:focus,
.btn-end-exam:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 키보드 접근성 */
.option-item[tabindex="0"] {
    cursor: pointer;
}

/* 법적 문서 페이지 스타일 */
.page-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #357abd 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.legal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    line-height: 1.8;
}

.legal-content section {
    margin-bottom: 40px;
}

.legal-content section:last-child {
    margin-bottom: 0;
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.legal-content h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
}

.legal-content ul {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* 문의 페이지 스타일 */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.contact-info,
.faq-section,
.feedback-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.contact-info h2,
.faq-section h2,
.feedback-section h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.info-card {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.email-link {
    margin-top: 15px;
    font-size: 1.1rem;
}

.email-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.email-link a:hover {
    text-decoration: underline;
}

.faq-item {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 15px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.faq-item p {
    color: var(--text-secondary);
    margin: 0;
}

/* Footer 스타일 */
.page-footer {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.page-footer p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-nav span {
    color: var(--text-secondary);
}

/* SNS 링크 숨김 처리 (SEO 및 소셜 미디어 검증용) */
.sns-links-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sns-links-hidden a {
    display: inline-block;
    width: 1px;
    height: 1px;
    overflow: hidden;
    text-indent: -9999px;
}

/* 블로그 스타일 */
.blog-content {
    margin-bottom: 40px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.blog-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-category {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.blog-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.blog-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.read-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 블로그 포스트 상세 페이지 스타일 */
.blog-post {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.blog-post-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.blog-post-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.blog-post-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.blog-post-content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.blog-post-content h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-post-content h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 25px;
    margin-bottom: 12px;
}

.blog-post-content p {
    margin-bottom: 20px;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.blog-post-content li {
    margin-bottom: 10px;
}

.blog-post-content pre {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid var(--primary-color);
}

.blog-post-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.blog-post-content table th,
.blog-post-content table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.blog-post-content table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
}

.blog-post-content table tr:nth-child(even) {
    background: var(--bg-light);
}

.blog-post-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-post-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.blog-post-content a:hover {
    text-decoration: underline;
}

.blog-post-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.btn-back {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #357abd;
}

/* 반응형 디자인 - 블로그 */
@media (max-width: 768px) {
    .blog-card {
        padding: 20px;
    }

    .blog-post {
        padding: 20px;
    }

    .blog-post-header h1 {
        font-size: 2rem;
    }

    .blog-post-content h2 {
        font-size: 1.5rem;
    }

    .blog-post-content h3 {
        font-size: 1.2rem;
    }

    .blog-post-content pre {
        padding: 15px;
        font-size: 0.85rem;
    }

    .blog-post-content table {
        font-size: 0.9rem;
    }

    .blog-post-content table th,
    .blog-post-content table td {
        padding: 8px;
    }
}
