/*
 * IIC Lab Website Stylesheet
 * -------------------------
 *
 * 1. 기본 및 전역 스타일
 * 2. 레이아웃 (헤더, 메인, 푸터)
 * 3. Thesis 페이지 전용 스타일
 * 4. 반응형 디자인
 *
 */

/* 1. 기본 및 전역 스타일
------------------------------------------------------- */
:root {
    --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    --accent-color: #007bff;
    --accent-darker: #0056b3;
    --accent-light: #e6f2ff;
    --text-primary: #212529;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 2. 레이아웃 (헤더, 메인, 푸터)
------------------------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1700px; /* 💡 4개 컬럼이 한 줄에 쾌적하게 들어가도록 전체 가로폭 확장 */
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.5rem;
    margin-left: 1.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: var(--accent-light);
}

.main {
    padding: 4rem 0;
    flex: 1;
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer strong {
    color: #f8f9fa;
}

/* 3. Thesis 페이지 전용 스타일
------------------------------------------------------- */
.section {
    padding: 2rem 0;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* 새 논문 업로드 버튼 */
.add-thesis-button-container {
    max-width: 900px;
    margin: 0 auto 2.5rem auto;
    text-align: right;
}

.btn-add-thesis {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-add-thesis:hover {
    background-color: var(--accent-darker);
}

/* 업로드 및 수정 폼 */
.upload-form-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--shadow-color);
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-muted);
    align-self: center;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.btn-submit, .btn-cancel {
    display: inline-block;
    min-width: 80px;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-submit { background-color: var(--accent-color); color: #fff; }
.btn-submit:hover { background-color: var(--accent-darker); }
.btn-cancel { background-color: #6c757d; color: #fff; margin-top: 0.5rem; }
.btn-cancel:hover { background-color: #5a6268; }

/* 논문 목록 카테고리 타이틀 */
.thesis-category-title {
    font-size: 1.25rem; /* 💡 4열 배치를 고려해 폰트 크기 최적화 */
    font-weight: 700;
    color: var(--accent-darker);
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
    text-align: center; /* 카테고리명 중앙 정렬 */
}

/* 개별 논문 박스 아이템 */
.thesis-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.2rem 1.5rem; /* 💡 좁은 가로폭에 맞게 패딩 최적화 */
    margin-bottom: 1.2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px var(--shadow-color);
    display: flex;
    flex-direction: column; /* 💡 타이틀, 저자, 날짜가 위아래로 정갈하게 떨어지도록 변경 */
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.thesis-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.thesis-info { width: 100%; }
.thesis-title { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.5rem; }
.thesis-authors { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.thesis-meta { font-size: 0.85rem; color: #888; line-height: 1.4; }
.thesis-location { font-style: italic; color: var(--accent-color); }

/* 💡 4분할 레이아웃 컨테이너 정밀 세팅 */
.thesis-columns-container {
    display: flex;
    justify-content: flex-start; /* 왼쪽부터 차례대로 정렬 */
    align-items: flex-start;
    flex-wrap: nowrap; /* 💡 절대로 아랫줄로 떨어지지 않도록 설정 강제 */
    gap: 20px; /* 컬럼 간격 */
    width: 100%;
    overflow-x: auto; /* 만약 가로 해상도가 너무 작아지면 스크롤바 생성 안전장치 */
    padding-bottom: 1rem;
}

/* 💡 컬럼 개별 속성 교정 (1줄에 4개 확정) */
.thesis-column {
    flex: 1 1 calc(25% - 20px); /* 💡 전체 가로폭을 정확히 25%씩 4등분 나누어 가집니다. */
    min-width: 280px; /* 깨짐 방지 최소 마지노선폭 */
}

.thesis-list p.no-data {
    color: #999;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.95rem;
}

/* 4. 반응형 디자인
------------------------------------------------------- */
@media (max-width: 1200px) {
    /* 💡 태블릿이나 노트북 화면에서는 2줄로 쾌적하게 쪼개지도록 유연성 확보 */
    .thesis-columns-container {
        flex-wrap: wrap;
    }
    .thesis-column {
        flex: 1 1 calc(50% - 20px); /* 2열 2행 구조로 변환 */
    }
}

@media (max-width: 768px) {
    /* 💡 모바일 화면에서는 스크롤 압박이 없도록 1열 종대로 길게 정렬 */
    .thesis-column {
        flex: 1 1 100%;
    }
    .section-title { font-size: 1.8rem; }
}