/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0044cc; /* 브로셔의 진한 파란색 */
    --accent-color: #2e8b57;  /* 농업을 상징하는 녹색 */
    --light-bg: #f8f9fa;
    --text-dark: #333;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-dark);
}

/* 헤더 */
header {
    background: #fff;
    border-bottom: 3px solid var(--primary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
}
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
header h1 {
    float: left;
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}
header h1 img {
    vertical-align: middle;
}
header nav {
    float: right;
    margin-top: 5px;
}
header nav ul { margin: 0; padding: 0; list-style: none; }
header nav li { display: inline; margin-left: 20px; }
header nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}
header nav a:hover { color: var(--primary-color); }

header nav a.login-link {
    color: var(--primary-color);
    font-weight: bold;
}

/* 메인 비주얼 (Hero) */
#hero {
    background: linear-gradient(rgba(0, 68, 204, 0.8), rgba(46, 139, 87, 0.8));
    background-size: cover;
    background-position: center;
    height: 450px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}
#hero h2 { font-size: 2.5rem; margin-bottom: 10px; }
#hero p { font-size: 1.2rem; font-weight: 300; }

/* 섹션 공통 */
section { padding: 4rem 0; }
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}
.section-title span { color: var(--accent-color); }

/* 설립 목적 */
.purpose-box {
    background: var(--light-bg);
    padding: 2rem;
    border-left: 5px solid var(--accent-color);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 비즈니스 그리드 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.card h3 { color: var(--primary-color); border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.card ul { padding-left: 20px; }
.card li { margin-bottom: 8px; }

/* 반응형 */
@media(max-width: 768px) {
    header h1, header nav { float: none; text-align: center; display: block; }
    header nav { margin-top: 20px; }
    #hero h2 { font-size: 1.8rem; }
    footer .footer-info span {
        display: block; /* Stack info vertically on mobile */
        margin: 3px 0;
    }
    footer .footer-info span::after {
        display: none; /* Hide separators on mobile */
    }
}

/* 푸터 스타일 */
footer {
    background: #343a40; /* Dark gray */
    color: #adb5bd; /* Light gray text */
    padding: 2rem 0;
    text-align: center;
    font-size: 0.875rem; /* 14px */
    line-height: 1.7;
}

footer .footer-nav {
    margin-bottom: 1rem;
}

footer .footer-nav a {
    color: #f8f9fa; /* White-ish */
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

footer .footer-nav a:hover {
    color: var(--primary-color);
}

footer .footer-info {
    margin-bottom: 1rem;
    font-style: normal; /* Reset address tag italic */
}

footer .footer-info span {
    display: inline-block;
}

/* Add separators for desktop */
footer .footer-info span:not(:last-child)::after {
    content: '|';
    color: #6c757d; /* Darker gray for separator */
    margin: 0 12px;
}

footer .copyright {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}

/* 드롭다운 메뉴 스타일 */
header nav li.dropdown {
    display: inline-block;
    position: relative; /* 하위 메뉴의 위치 기준점 설정 */
}

header nav .dropbtn {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    border: 1px solid #eee;
    /* margin-top: 5px; /* 마우스 이동 시 메뉴가 사라지는 원인 */
    padding-top: 5px; /* 드롭다운 박스 안쪽에 여백을 주어 시각적 간격 유지 */
    padding-bottom: 5px;
}

/* 사용자 메뉴의 드롭다운은 오른쪽 정렬 */
.user-dropdown .dropdown-content {
    right: 0;
}

.dropdown-content a,
.dropdown-content-submenu a {
    color: var(--text-dark);
    padding: 10px 16px; /* 내부 여백에 맞게 패딩 조정 */
    text-decoration: none;
    display: block;
    text-align: left;
    font-weight: 400; /* 일반 텍스트 굵기 */
    box-sizing: border-box;
}

.dropdown-content a:hover,
.dropdown-content-submenu a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

.dropdown-content a.logout-link {
    color: var(--primary-color);
    font-weight: bold;
}

/* 드롭다운 메뉴에 마우스 올렸을 때 내용 표시 */
.dropdown:hover .dropdown-content {
    display: block;
}

/* 3단 드롭다운 메뉴 스타일 추가 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropbtn-submenu {
    cursor: default;
}

.dropdown-content-submenu {
    display: none;
    position: absolute;
    left: 100%; /* 2단 메뉴 오른쪽에 표시 */
    top: 0; /* 2단 메뉴 항목과 같은 높이에서 시작 */
    
    /* 기존 .dropdown-content 스타일과 유사하게 적용 */
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    border: 1px solid #eee;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* 2단 메뉴 항목에 호버 시, 3단 메뉴 표시 */
.dropdown-submenu:hover > .dropdown-content-submenu {
    display: block;
}

/* 사용자 메뉴 아바타 스타일 */
.user-menu .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid #ddd;
}

/* 관리자 페이지 스타일 */
.admin-table-container {
    overflow-x: auto; /* 모바일에서 테이블이 넘칠 경우 스크롤 */
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    font-size: 0.95rem;
}

.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.admin-table thead {
    background-color: var(--light-bg);
}

.admin-table th {
    font-weight: 500;
    color: var(--primary-color);
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-table tbody tr:hover {
    background-color: #f1f1f1;
}

.role-checkboxes {
    line-height: 1.8;
}

.role-checkboxes label {
    display: inline-block;
    margin: 0 8px 5px 0;
}

.role-checkboxes input[type="checkbox"] {
    display: none; /* 실제 체크박스 숨기기 */
}

.role-checkboxes span {
    display: block;
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    color: #495057;
}

.role-checkboxes input[type="checkbox"]:hover + span {
    border-color: #999;
}

.role-checkboxes input[type="checkbox"]:checked + span {
    background-color: var(--accent-color); /* 녹색 */
    color: #fff;
    border-color: var(--accent-color);
    font-weight: 500;
}

.btn-save {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-save:hover {
    background-color: #003399;
}

/* 알림 메시지 스타일 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* 찾아오시는 길 페이지 스타일 */
.directions-container {
    max-width: 900px;
    margin: 0 auto;
}

.address-info {
    background-color: var(--light-bg);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin: 2.5rem 0;
    text-align: center;
    border: 1px solid #e9ecef;
}

.address-info h3 {
    color: var(--primary-color);
    margin-top: 0;
}

.address-info p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0;
    color: var(--text-dark);
}

.transport-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.transport-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #fff;
}

.transport-card h4 {
    color: var(--accent-color);
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.transport-card ul {
    padding-left: 20px;
    color: #555;
    font-size: 0.95rem;
}

.transport-card li {
    margin-bottom: 10px;
}

/* 자격증 시험 페이지 스타일 */
.exam-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.exam-select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
    background-color: #fff;
}

.exam-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.question-container {
    margin-top: 2rem;
    border-top: 2px solid var(--primary-color);
    padding-top: 2rem;
}

.guide-text {
    text-align: center;
    color: #888;
    font-size: 1.2rem;
    padding: 3rem 0;
}
.guide-text.error {
    color: #dc3545;
}

.question-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.question-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.7;
}

.question-example {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    font-size: 0.95rem;
}
.question-example pre {
    margin: 0;
    white-space: pre-wrap; /* 긴 텍스트 줄바꿈 */
    font-family: 'Noto Sans KR', sans-serif;
}

.question-options p {
    margin: 8px 0;
}

/* 교사용 모드 정답 표시 */
.question-options p.correct-answer {
    color: #dc3545;
    font-weight: bold;
}

/* 학생용 문제풀이 스타일 */
.btn-start-exam {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-start-exam:hover {
    background-color: #257247;
}

.option-label {
    display: block;
    padding: 8px 12px;
    margin: 5px 0;
    border: 1px solid #eee;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative; /* 아이콘 위치 기준 */
    padding-right: 60px; /* 아이콘 공간 확보 */
}
.option-label:hover {
    background-color: #f8f9fa;
}
.option-label input[type="radio"] {
    margin-right: 10px;
    vertical-align: middle;
}
.option-label .option-text {
    vertical-align: middle;
}

/* 채점 후 스타일 (개선) */
/* 채점 후 아이콘 기본 스타일 */
.option-label.graded::after {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 2em;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
}

/* 사용자가 정답을 맞혔을 때: 녹색 동그라미 */
.option-label.user-choice-correct {
    background-color: #e7f4e8; /* 연한 녹색 배경 */
    border-color: #5cb85c;
}
.option-label.graded.user-choice-correct::after {
    content: 'O';
    color: #5cb85c;
    border: 2.5px solid #5cb85c;
    border-radius: 50%;
    font-size: 2.2em;
    line-height: 28px; /* O 글자 수직 정렬 */
}

/* 사용자가 오답을 선택했을 때: 붉은색 X */
.option-label.user-choice-incorrect {
    background-color: #fbe9e9; /* 연한 붉은색 배경 */
    border-color: #d9534f;
    opacity: 0.8; /* 틀린 선택지를 약간 흐리게 */
}
.option-label.graded.user-choice-incorrect::after {
    content: 'X';
    color: #d9534f;
    font-size: 2.5em;
}

/* 실제 정답 표시 (사용자가 틀렸을 경우) */
.option-label.actual-correct {
    border: 2px solid var(--primary-color);
    font-weight: bold;
}
.option-label.actual-correct .option-text::before {
    content: '정답 👉';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 8px;
}

.explanation-wrapper {
    margin-top: 15px;
    text-align: right;
}

.question-explanation {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.7;
}

.question-explanation p {
    margin: 0 0 10px 0;
}

.exam-result {
    background-color: var(--light-bg);
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 8px;
}
.exam-result h3 {
    margin: 0;
    color: var(--primary-color);
}

/* 문제 분석 버튼 */
.btn-analysis {
    background-color: #6c757d; /* Gray */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}
.btn-analysis:hover {
    background-color: #5a6268;
}

/* 문제 분석 테이블 */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    font-size: 0.9rem;
    table-layout: fixed; /* 테이블 레이아웃을 고정하여 컬럼 너비 제어 */
    user-select: none; /* 텍스트 드래그 방지 */
}
.analysis-table th, .analysis-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    word-wrap: break-word; /* 긴 텍스트가 컬럼을 넘치지 않도록 */
}
.analysis-table thead {
    background-color: var(--light-bg);
    font-weight: 500;
}
.analysis-table .subject-row {
    background-color: #e9ecef;
    font-size: 1.05rem;
}
/* 컬럼별 너비 지정 */
.analysis-table th:nth-child(1),
.analysis-table td:nth-child(1) {
    width: auto; /* 남은 공간을 차지하되, 최소 너비 설정 */
    min-width: 280px;
}
.analysis-table th:nth-child(2),
.analysis-table td:nth-child(2) {
    text-align: center;
    width: 150px;
}
.analysis-table th:nth-child(3),
.analysis-table td:nth-child(3) {
    text-align: center;
    width: 150px;
}
.analysis-table th:nth-child(4),
.analysis-table td:nth-child(4) {
    width: 120px; /* '설명' 버튼 컬럼 */
    text-align: center;
}

/* 계층별 들여쓰기 및 폰트 스타일 */
.analysis-table td.level-1 { font-weight: 500; }
.analysis-table td.level-2 { color: #333; }
.analysis-table td.level-3 { color: #555; font-size: 0.85rem; }

.analysis-table td a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.analysis-table td a:hover {
    text-decoration: underline;
}

/* 토글 아이콘 스타일 */
.toggle-icon {
    cursor: pointer;
    margin-right: 5px;
    font-weight: bold;
    display: inline-block;
    width: 1em; /* Fixed width for alignment */
    text-align: center;
    color: var(--primary-color);
}
.toggle-icon.no-children {
    cursor: default;
    color: #ccc; /* 자식 없는 항목은 아이콘을 흐리게 */
}
/* 토글 아이콘 스타일 */
.toggle-icon {
    cursor: pointer;
    margin-right: 5px;
    font-weight: bold;
    display: inline-flex; /* Use inline-flex for better centering */
    align-items: center;
    justify-content: center;
    width: 1.5em; /* Give it a fixed size */
    height: 1.5em;
    border: 1px solid var(--primary-color); /* Add a border to make it visible */
    border-radius: 50%; /* Make it round */
    color: var(--primary-color);
    font-size: 0.9rem; /* Adjust font size */
    vertical-align: middle; /* Align with text */
    flex-shrink: 0; /* Prevent it from shrinking */
}
.toggle-icon.no-children {
    cursor: default;
    color: #ccc;
    border-color: #ccc;
    background-color: #f0f0f0; /* Lighter background for no-children */
}
.toggle-icon.collapsed::before { content: '+'; } /* Plus sign */
.toggle-icon.expanded::before { content: '-'; } /* Minus sign */

/* 문제 분석 테이블 초기 상태: 과목 행을 제외한 모든 하위 레벨 행 숨기기 */
.analysis-table tbody tr[data-level="1"],
.analysis-table tbody tr[data-level="2"],
.analysis-table tbody tr[data-level="3"] {
    display: none;
}


/* 단원설명 버튼 */
.btn-edit-desc {
    background-color: #007bff; /* Blue */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s;
    margin-left: 5px;
    display: inline-block; /* Ensure it takes up space */
}
.btn-edit-desc:hover {
    background-color: #0056b3;
}

/* 모달 스타일 */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    position: relative;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-content p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.modal-content textarea {
    width: calc(100% - 20px); /* Adjust for padding */
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical; /* Allow vertical resizing */
    font-family: 'Noto Sans KR', sans-serif;
}

.modal-actions {
    text-align: right;
}

.modal-actions button {
    margin-left: 10px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* 타이머 스타일 */
.timer-container {
    position: fixed;
    top: 80px; /* 헤더 높이 고려 */
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1001;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
}
@media(max-width: 768px) {
    .timer-container { top: 15px; right: 15px; padding: 8px 12px; font-size: 1rem; }
}

.btn-pause {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
    cursor: pointer;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    margin-left: 10px;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

/* 유기농업기사 핵심공부 페이지 (study_organic.php) */
.study-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.study-header-title-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-grow: 1;
}
.study-header-icon {
    font-size: 2rem;
    color: var(--accent-color);
}
.study-header-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}
.study-header-subtitle {
    color: #4b5563;
    margin-bottom: 0.75rem;
}
.study-header-badge {
    display: inline-block;
    background-color: #f0fdf4;
    color: var(--accent-color);
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.9rem;
}

.study-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    max-width: 448px;
    margin-left: auto;
    margin-right: auto;
}
.study-tab-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    background-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
}
.study-tab-btn:hover {
    background-color: #f3f4f6;
}
.study-tab-btn.active {
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.study-tab-btn.active[data-tab="summary"] {
    background-color: var(--accent-color); /* green */
}
.study-tab-btn.active[data-tab="flashcard"] {
    background-color: #4f46e5; /* indigo */
}

.study-tab-content {
    display: none;
}
.study-tab-content.active {
    display: block;
}

/* 요약 노트 모드 */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.summary-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
    border-left: 4px solid var(--accent-color);
}
.summary-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}
.summary-card-inner {
    padding: 1.5rem;
}
.summary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.summary-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f0fdf4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.summary-card-icon {
    font-size: 1.5rem;
}
.summary-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}
.summary-card-content-wrapper {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.summary-card-content {
    color: #374151;
    white-space: pre-line;
    line-height: 1.6;
}
.summary-card-highlight-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background-color: #fefce8;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #854d0e;
    font-weight: 500;
}
.summary-card-highlight-wrapper i {
    margin-top: 0.125rem;
}

/* 암기 카드 모드 */
.flashcard-container {
    max-width: 576px;
    margin-left: auto;
    margin-right: auto;
    perspective: 1000px;
}
.flashcard {
    position: relative;
    width: 100%;
    height: 24rem; /* 384px */
    cursor: pointer;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}
.flashcard.is-flipped {
    transform: rotateY(180deg);
}
.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
.flashcard-front {
    background-color: #fff;
    border: 2px solid #e0e7ff;
}
.flashcard-back {
    background-color: #4f46e5; /* indigo */
    color: #fff;
    transform: rotateY(180deg);
}
.flashcard-category {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #4f46e5;
    background-color: #eef2ff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}
.flashcard-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: #1f2937;
    line-height: 1.3;
}
.flashcard-prompt {
    margin-top: 2rem;
    color: #9ca3af;
    font-size: 0.9rem;
    animation: bounce 1.5s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
.flashcard-back-content-wrapper {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}
.flashcard-back-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}
.flashcard-back-content {
    font-size: 1.1rem;
    white-space: pre-line;
    line-height: 1.6;
    font-weight: 500;
    margin: 0;
}
.flashcard-back-highlight-wrapper {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(251, 191, 36, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
}
.flashcard-back-highlight-wrapper i {
    color: #facc15;
}
.flashcard-back-highlight {
    color: #fef08a;
    font-weight: 700;
    font-size: 0.9rem;
}
.flashcard-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding: 0 1rem;
    max-width: 576px;
    margin-left: auto;
    margin-right: auto;
}
.flashcard-nav-btn {
    padding: 0.75rem;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    color: #4b5563;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}
.flashcard-nav-btn:hover {
    background-color: #f9fafb;
}
.flashcard-counter {
    font-weight: 700;
    color: #6b7280;
}
.flashcard-guide {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* 핵심공부 페이지 네비게이션 */
.study-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.study-nav-arrow {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.study-nav-arrow:hover {
    background-color: #f0f4ff;
}
.study-nav-arrow.disabled {
    color: #ccc;
    pointer-events: none;
    visibility: hidden; /* 아예 안보이게 */
}

/* Visitor Counter */
/* 푸터로 이동하면서 스타일 변경 */
.visitor-counter {
    margin-top: 1rem; /* copyright과의 간격 */
    font-size: 0.75rem; /* 더 작게 */
    color: #6c757d; /* copyright과 비슷한 톤의 어두운 회색 */
}
