/* 시간표 페이지 스타일 */

.schedule-page {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #fff;
}

.schedule-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 페이지 제목 */
.page-title {
    font-size: 42px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

/* 과목/학년별 탭 메뉴 */
.schedule-tabs {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-bottom: 2rem;
}

.schedule-tab {
    flex: 1;
    background-color: #f1f1f1;
    padding: 10px 1rem;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 18px;
}

.schedule-tab.active {
    background-color: #a6a6a9;
    color: white;
    font-weight: bold;
}

/* 최신글 표시 */
.latest-post {
    padding: 0;
    margin-bottom: 2rem;
    border: none;
    background: none;
}

.latest-post-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 2px solid #333;
}

.latest-post-meta {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: none;
}

.latest-post-meta .author,
.latest-post-meta .date {
    color: #666;
    font-size: 14px;
}

.latest-post-content {
    line-height: 1.6;
    margin-top: 1rem;
    padding: 0;
}

/* 동적 로딩 스타일 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #345f53;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin: 1rem 0;
}

.error-detail {
    font-size: 14px;
    color: #856404;
    margin-top: 0.5rem;
}

/* 시간표 공지사항 스타일 */
.schedule-notice {
    background: linear-gradient(135deg, #f5e6a3 0%, #f0d982 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.notice-header h3 {
    font-size: 32px;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 0.5rem;
}

.notice-header h4 {
    font-size: 24px;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 1.5rem;
}

.notice-content {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.notice-footer .logo {
    font-size: 18px;
    font-weight: bold;
    color: #8b4513;
}

/* 연락처 정보 */
.contact-info {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    line-height: 1.8;
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-info .phone-number {
    font-size: 18px;
    font-weight: bold;
    color: #d63384;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* 게시글 목록 섹션 */
.post-list-section {
    margin-top: 3rem;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #345f53;
}

/* 게시글 테이블 */
.post-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.post-table th,
.post-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.post-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
    border-top: 2px solid #345f53;
}

.post-table td {
    color: #666;
}

.post-table td:nth-child(2) {
    text-align: left;
}

.post-table td a {
    color: #333;
    text-decoration: none;
}

.post-table td a:hover {
    color: #345f53;
    text-decoration: underline;
}

/* 활성화된 게시글 행 스타일 */
.post-table tbody tr.active {
    background-color: #e3f2fd !important;
    border-left: 4px solid #345f53;
}

.post-table tbody tr.active td {
    color: #333;
    font-weight: 500;
}

.post-table tbody tr.active a {
    color: #345f53;
    font-weight: bold;
}

/* 페이지네이션 */
.pagination {
    text-align: center;
    margin: 2rem 0;
}

.page-number {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}

.page-number.active {
    background-color: #345f53;
    color: white;
    border-color: #345f53;
}

/* 검색 섹션 */
.search-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.search-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.search-btn {
    padding: 0.5rem 1.5rem;
    background-color: #345f53;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #2a4c42;
}

/* 게시글 없음 메시지 */
.no-posts {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 16px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .schedule-page .container {
        padding: 1.5rem 1rem;
    }
    
    .page-title {
        font-size: 32px;
        margin-bottom: 2rem;
    }
    
    .schedule-tabs {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .schedule-tab {
        padding: 0.5rem 1rem;
        font-size: 14px;
    }
    
    .latest-post {
        padding: 0;
        margin-bottom: 2rem;
    }
    
    .latest-post-title {
        font-size: 20px;
    }
    
    .latest-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .schedule-notice {
        padding: 1.5rem;
    }
    
    .notice-header h3 {
        font-size: 24px;
    }
    
    .notice-header h4 {
        font-size: 18px;
    }
    
    .post-table {
        font-size: 14px;
    }
    
    .post-table th,
    .post-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        justify-content: center;
    }
    
    .search-input {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .schedule-page .container {
        padding: 1rem 0.5rem;
    }
    
    .page-title {
        font-size: 28px;
        margin-bottom: 1.5rem;
    }
    
    .schedule-tabs {
        gap: 10px;
    }
    
    .schedule-tab {
        padding: 0.4rem 0.8rem;
        font-size: 12px;
        text-align: center;
    }
    
    .latest-post {
        padding: 0;
    }
    
    .latest-post-title {
        font-size: 18px;
    }
    
    .schedule-notice {
        padding: 1rem;
    }
    
    .notice-header h3 {
        font-size: 20px;
    }
    
    .notice-header h4 {
        font-size: 16px;
    }
    
    .contact-info {
        padding: 1rem;
        font-size: 14px;
    }
    
    .post-table {
        font-size: 12px;
    }
    
    .post-table th,
    .post-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* 관리자 버튼 스타일 */
.admin-buttons {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    justify-content: flex-end;
}

.admin-btn {
    background-color: #345f53;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.admin-btn:hover {
    background-color: #2a4d42;
    color: white;
    text-decoration: none;
}

.admin-btn.btn-edit {
    background-color: #345f53;
}

.admin-btn.btn-delete {
    background-color: #345f53;
}

.admin-btn.btn-write {
    background-color: #345f53;
    margin-top: 1rem;
}

.admin-btn:active {
    transform: translateY(1px);
}

/* 관리자 버튼 컨테이너 - 최신글과 목록 사이 */
.admin-section {
    margin: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

/* 글쓰기 버튼 컨테이너 - 검색창 아래 */
.write-section {
    text-align: center;
    margin-top: 1.5rem;
}