/* 원불교정책연구소 아카이브 스타일 */
/* 헤더 스타일 */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-top: 1.5rem; /* 상단 여백 추가 */
    margin-bottom: 2rem;
    width: 100%;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #004080;
    --accent-color: #ff9900;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --success-color: #4CAF50;
    --error-color: #f44336;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.logo {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-title h1 {
    margin-bottom: 0;
    text-align: left;
}

body {
    font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    overflow-x: hidden;
}

/* 헤더 스타일 */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
    width: 100%;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2.5rem); /* 반응형 폰트 크기 */
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0 10px;
}

nav ul li {
    margin: 0.5rem;}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* 메인 콘텐츠 */
main {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: clamp(1rem, 4vw, 2rem); /* 반응형 패딩 */
    margin-bottom: 2rem;
    width: 100%;
}

section {
    margin-bottom: 2rem;
}

h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    color: var(--secondary-color);
    margin: 1rem 0;
}

/* 검색 섹션 */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-container input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 200px;
}

.search-container select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 150px;
}

.search-container button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-container button:hover {
    background-color: var(--secondary-color);
}

/* 레코드 목록 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

table th, table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--light-gray);
    font-weight: bold;
}

table tr:hover {
    background-color: #f9f9f9;
}

table a {
    color: var(--primary-color);
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 5px;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination span.current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 레코드 상세 보기 */
.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.record-detail h2 {
    color: var(--secondary-color);
    border-bottom: none;
    margin-bottom: 1rem;
}

.record-actions {
    margin-bottom: 1.5rem;
    text-align: right;
}

.btn-add-files {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-add-files:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
    color: white;
}

.meta-info {
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.meta-info p {
    margin-bottom: 0.5rem;
}

.description {
    margin-bottom: 1.5rem;
}

.file-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.files-table th, 
.files-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.files-table th {
    background-color: var(--light-gray);
    font-weight: bold;
}

.file-icon {
    margin-right: 10px;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.download-link, .delete-link {
    display: inline-block;
    padding: 4px 8px;
    margin-right: 5px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.download-link {
    background-color: var(--accent-color);
    color: white;
}

.download-link:hover {
    background-color: #e68a00;
    text-decoration: none;
    color: white;
}

.delete-link {
    background-color: #dc3545;
    color: white;
}

.delete-link:hover {
    background-color: #bd2130;
    text-decoration: none;
    color: white;
}

.no-files {
    font-style: italic;
    color: #6c757d;
    text-align: center;
    padding: 1rem;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.required {
    color: red;
}

.form-actions {
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.help-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 메시지 스타일 */
.message {
    padding: 15px;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.success {
    background-color: #dff0d8;
    color: var(--success-color);
    border-left: 5px solid var(--success-color);
}

.error {
    background-color: #f8d7da;
    color: var(--error-color);
    border-left: 5px solid var(--error-color);
}

/* 로그인 섹션 스타일 */
.login-section {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.login-form .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.login-form .form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.login-form .btn-primary {
    padding: 12px 20px;
    width: 48%;
}

.login-form .btn-secondary {
    padding: 12px 20px;
    width: 48%;
}

/* 대시보드 스타일 */
.dashboard-welcome {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 2rem;
    border-left: 5px solid var(--primary-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.dashboard-stats, 
.dashboard-recent, 
.dashboard-categories {
    background-color: white;
    padding: 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.dashboard-stats h3,
.dashboard-recent h3,
.dashboard-categories h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f2f2f2;
    margin-bottom: 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    border-bottom: 3px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card:nth-child(1) {
    border-bottom-color: #4CAF50; /* Green */
}

.stat-card:nth-child(2) {
    border-bottom-color: #2196F3; /* Blue */
}

.stat-card:nth-child(3) {
    border-bottom-color: #FFC107; /* Yellow */
}

.stat-card:nth-child(4) {
    border-bottom-color: #9C27B0; /* Purple */
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    table-layout: fixed;
}

.dashboard-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 15px;
}

.dashboard-table td {
    font-size: 0.95rem;
    padding: 12px 15px;
    word-break: break-word;
}

.dashboard-link {
    margin-top: 1.25rem;
    text-align: right;
}

.dashboard-link a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.dashboard-link a:hover {
    text-decoration: underline;
}

.btn-edit,
.btn-delete {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    margin-right: 5px;
    display: inline-block;
}

.btn-edit {
    background-color: var(--primary-color);
}

.btn-edit:hover {
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #bd2130;
    color: white;
    text-decoration: none;
}

/* 관리자 관리 스타일 */
.dashboard-admins {
    background-color: white;
    padding: 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-admins h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f2f2f2;
    margin-bottom: 1.25rem;
}

.admin-management {
    width: 100%;
}

.admin-form {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.admin-form h4 {
    margin-top: 0;
    color: var(--secondary-color);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    justify-content: space-between;
}

.form-group-inline {
    padding: 0 10px;
    flex: 1;
    min-width: 200px;
}

.admin-table {
    margin-top: 1.5rem;
}

.delete-admin-btn, .edit-admin-btn {
    cursor: pointer;
    border: none;
    font-size: 0.75rem;
    margin: 2px;
}

/* 연혁 스타일 */
.history-timeline {
    margin: 1rem 0 2rem 1.5rem;
    position: relative;
}

.history-timeline:before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background-color: var(--primary-color);
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.timeline-year {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-content p {
    margin: 0.3rem 0;
}

.timeline-content p:first-child {
    margin-top: 0;
}

.timeline-content p:last-child {
    margin-bottom: 0;
}


/* 반응형 디자인을 위한 미디어 쿼리 */
/* 태블릿 화면 (768px 이하) */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    nav ul {
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 0 0.5rem 0.5rem 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .login-form .form-actions {
        flex-direction: column;
    }
    
    .login-form .btn-primary,
    .login-form .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 테이블 관련 조정 */
    .dashboard-table th, 
    .dashboard-table td {
        padding: 8px 5px;
    }
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    width: 100%;
}

footer p {
    margin: 0;
    color: var(--text-color);
}

/* 모바일 화면 (480px 이하) */
@media screen and (max-width: 980px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 1rem;
    }
    
    /* 이미지 반응형 처리 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem 0.5rem;
    }
    
    .dashboard-welcome {
        padding: 1rem;
    }
    
    .dashboard-stats, 
    .dashboard-recent, 
    .dashboard-categories {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-container input[type="text"],
    .search-container select,
    .search-container button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 버튼 크기 조정 */
    .btn-edit, .btn-delete {
        display: block;
        margin-bottom: 5px;
        text-align: center;
    }
    
    /* 메타데이터 섹션 조정 */
    .meta-info {
        padding: 10px;
    }
    
    /* 테이블 헤더 숨기기 옵션 (매우 작은 화면용) */
    .files-table thead {
        display: none;
    }
    
    .files-table tbody td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    
    .files-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}
