/* 전체 스타일 */    
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* 타임테이블 래퍼 */
.timetable-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 헤더 컨테이너 */
.header-container {
    background: linear-gradient(135deg, #4a6bff, #2541b2);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-container h1 {
    font-size: 28px;
    font-weight: 700;
}

.session-counter {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 콘텐츠 컨테이너 */
.content-container {
    padding: 30px;
}

/* 검색 컨테이너 */
.search-container {
    margin-bottom: 25px;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.select-styled {
    padding: 0px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 14px;
    min-width: 150px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.select-styled:focus {
    border-color: #4a6bff;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

.input-styled {
  font-size: 16px;           /* 원하는 크기 */
  line-height: normal;       /* ← 핵심: 잘림 방지 */
  padding: 8px 12px;         /* 상하 패딩으로 높이 확보 */
  height: auto;              /* 고정 높이 제거 */
  min-height: 38px;          /* 최소 높이 보장 (필요시 숫자 조절) */
  box-sizing: border-box;
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;  /* iOS/Safari */
}

/* 혹시 전역에서 줄 간격을 강제로 1로 고정했다면 이걸로 덮어쓰기 */
select.input-styled { line-height: normal !important; }

/* 드롭다운 목록의 폰트 크기도 맞추고 싶다면(브라우저별 적용 다름) */
#S_TOPIC option { font-size: inherit; }

.input-styled:focus {
    border-color: #4a6bff;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

.btn-search {
    padding: 10px 20px;
    background-color: #4a6bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-search:hover {
    background-color: #3a5ae8;
}

/* 테이블 액션 */
.table-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.btn-add {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-add:hover {
    background-color: #3d8b40;
}

/* 테이블 컨테이너 */
.table-container {
    overflow-x: auto;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.timetable-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.timetable-table th {
    background-color: #f0f4f8;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #ddd;
}

.timetable-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.timetable-table tbody tr {
    transition: background-color 0.3s;
}

.timetable-table tbody tr:hover {
    background-color: #f9fafc;
}

.timetable-table tbody tr.highlight {
    background-color: #fff8e1;
}

/* 테이블 셀 내용 */
.session-code {
    font-weight: 600;
    color: #4a6bff;
}

.session-title {
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-room {
    display: flex;
    flex-direction: column;
}

.room-code {
    font-weight: 600;
    color: #555;
}

.room-name {
    font-size: 13px;
    color: #777;
}

.session-datetime {
    display: flex;
    flex-direction: column;
}

.session-date {
    font-weight: 500;
}

.session-day {
    font-size: 13px;
    color: #777;
}

.session-time {
    font-size: 13px;
    color: #555;
    margin-top: 5px;
}

.session-chair {
    max-width: 200px;
}

.chair-name {
    font-weight: 500;
}

.chair-affiliation {
    font-size: 13px;
    color: #777;
    margin-top: 3px;
}

.session-comment {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #666;
}

/* 테이블 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-view {
    padding: 6px 12px;
    background-color: #4a6bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-view:hover {
    background-color: #3a5ae8;
}

.btn-delete {
    padding: 6px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-delete:hover {
    background-color: #d32f2f;
}

.btn-save {
    padding: 10px 20px;
    background-color: #4a6bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.btn-cancel {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background-color: #e5e5e5;
}

/* 모달 */
#sessionModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

#sessionModal .modal-content {
    background-color: #fff;
    margin: 50px auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#sessionModal .modal-header {
    background: linear-gradient(135deg, #4a6bff, #2541b2);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#sessionModal .modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

#sessionModal .close-modal {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#sessionModal .modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

#sessionModal .modal-footer {
    padding: 15px 20px;
    background-color: #f5f7fa;
    border-top: 1px solid #eee;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 폼 그룹 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    background-color: #f0f8ff; /* 연한 파란색 배경 */
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #d0e4ff;
    flex: 1 1 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
    margin-bottom: 12px;
}

.form-group.half {
    flex: 1 1 calc(50% - 8px); /* 두 칸 분할용 */
}

.form-group:hover {
    background-color: #e6f0ff;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007bff;
    outline: none;
    background-color: #fff;
}

.chair-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chair-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.chair-editor-heading label {
    margin-bottom: 0;
}

.chair-candidate-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #2563eb;
    border-radius: 5px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    cursor: pointer;
}

.chair-candidate-search-btn:hover {
    background: #eff6ff;
}

.chair-candidate-search-btn:disabled {
    display: none;
}

.chair-candidate-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    padding: 24px;
    background: rgba(15, 23, 42, 0.58);
    overflow-y: auto;
}

.chair-candidate-modal[hidden] {
    display: none !important;
}

.chair-candidate-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chair-candidate-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.chair-candidate-header,
.chair-candidate-footer,
.chair-candidate-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
}

.chair-candidate-header {
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.chair-candidate-header h3,
.chair-candidate-header p {
    margin: 0;
}

.chair-candidate-header h3 {
    font-size: 20px;
}

.chair-candidate-header p {
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
}

.chair-candidate-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-size: 25px;
    cursor: pointer;
}

.chair-candidate-toolbar {
    border-bottom: 1px solid #e2e8f0;
}

.chair-candidate-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
}

.chair-candidate-search-box input,
.chair-candidate-toolbar select {
    height: 40px;
    border: 0;
    background: #fff;
    outline: none;
}

.chair-candidate-search-box input {
    width: 100%;
}

.chair-candidate-toolbar select {
    min-width: 130px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
}

.chair-candidate-status {
    padding: 12px 20px;
    color: #64748b;
    font-size: 13px;
}

.chair-candidate-list {
    min-height: 220px;
    padding: 0 20px 18px;
    overflow-y: auto;
}

.chair-candidate-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    cursor: pointer;
}

.chair-candidate-item:hover,
.chair-candidate-item.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.chair-candidate-item input {
    width: 17px;
    height: 17px;
}

.chair-candidate-name {
    font-weight: 800;
    color: #0f172a;
}

.chair-candidate-meta {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.chair-candidate-source {
    padding: 4px 8px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.chair-candidate-footer {
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
}

.input-styled.small {
    width: 80px;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    #sessionModal .modal-content {
        width: 95%;  
        margin: 20px auto;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .select-styled, .input-styled {
        width: 100%;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
    }

    .chair-candidate-modal {
        padding: 12px;
    }

    .chair-candidate-dialog {
        max-height: calc(100vh - 24px);
    }

    .chair-candidate-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .chair-candidate-toolbar select {
        width: 100%;
    }

    .chair-candidate-item {
        grid-template-columns: auto 1fr;
    }

    .chair-candidate-source {
        grid-column: 2;
        justify-self: start;
    }
}
