/* 방문객 페이지 스타일 - 모델 이벤트 타임테이블 (반응형) */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.header h1 {
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

/* 운영 시간 정보 */
.operation-info {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
}

/* 컨트롤 패널 */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.date-selector {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.view-selector {
    display: flex;
    gap: 10px;
}

/* 필터 버튼 */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 1em;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.filter-btn i {
    margin-right: 5px;
}

/* 뷰 전환 버튼 */
.view-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 스크롤 힌트 */
.scroll-hint {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.scroll-hint i {
    margin: 0 5px;
}

/* 테이블 뷰 컨테이너 */
.table-view {
    display: none;
}

.table-view.active {
    display: block;
}

.timetable-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.timetable th,
.timetable td {
    border: 2px solid #ddd;
    padding: 0;
    text-align: center;
}

.timetable th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 15px;
    font-size: 1.1em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timetable .time-header {
    width: 120px;
}

.timetable .model-header {
    min-width: 150px;
}

.time-cell {
    font-weight: 600;
    padding: 15px 10px;
    background: #f8f9fa;
    font-size: 1em;
    color: #555;
    width: 120px;
    /* rowspan(병합셀) 사용 시, 어떤 행은 schedule-cell이 없어져서
       브라우저가 행 높이를 줄여버리는 경우가 있습니다.
       time-cell이 항상 존재하므로, 여기에서 행 높이를 고정합니다. */
    height: 60px;
    vertical-align: middle;
}

.schedule-cell {
    height: 60px;
    position: relative;
    padding: 0;
    vertical-align: middle;
}

/* 30분 슬롯(테이블 뷰) 행 높이 고정: 간헐적으로 줄어드는 현상 방지 */
.timetable tbody tr {
    height: 60px;
}

/* 현재 시간 하이라이트 */
.current-time-row .time-cell,
.current-time-row .schedule-cell {
    background-color: #fff9c4 !important;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { background-color: #fff9c4; }
    50% { background-color: #ffeb3b; }
}

/* 스케줄 아이템 (읽기 전용) */
.schedule-item {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: calc(100% - 4px);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 이벤트 타입별 색상 */
.schedule-item.event-checktime {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.schedule-item.event-photozone {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
}

.schedule-item.event-autograph {
    background: linear-gradient(135deg, #95E1D3 0%, #7DD4C4 100%);
    color: #333;
    text-shadow: none;
}

/* 30분(1칸) 스케줄 컴팩트 레이아웃 */
.schedule-item .schedule-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

.schedule-item.schedule-compact .schedule-content {
    flex-direction: row;
    gap: 8px;
    padding: 0 5px;
}

.schedule-item .schedule-icon {
    font-size: 1.2em;
}

.schedule-item.schedule-compact .schedule-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.schedule-item .schedule-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.schedule-item.schedule-compact .schedule-info {
    flex: 1;
    align-items: flex-start;
    gap: 2px;
}

.schedule-item .schedule-name {
    font-weight: 600;
}

.schedule-item.schedule-compact .schedule-name {
    font-size: 0.85em;
    line-height: 1.1;
}

.schedule-item .schedule-time {
    font-size: 0.85em;
    opacity: 0.9;
}

.schedule-item.schedule-compact .schedule-time {
    font-size: 0.75em;
    line-height: 1.1;
    white-space: nowrap;
}

/* 컴팩트 테이블 뷰 (모바일 최적화) */
.compact-view {
    display: none;
}

.compact-view.active {
    display: block;
}

.compact-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 480px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 11px;
}

.compact-table th,
.compact-table td {
    border: 1px solid #ddd;
    padding: 0;
    text-align: center;
}

.compact-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 8px 5px;
    font-size: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.compact-table .time-header {
    width: 38px;
    position: sticky;
    left: 0;
    z-index: 11;
}

.compact-table .model-header {
    min-width: 60px;
    max-width: 80px;
}

.compact-table .time-cell {
    font-weight: 600;
    padding: 3px 2px;
    background: #f8f9fa;
    font-size: 9px;
    color: #555;
    width: 38px;
    height: 25px;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #999;
}

.compact-table .schedule-cell {
    height: 25px;
    position: relative;
    padding: 0;
    min-width: 60px;
}

/* 30분 슬롯(컴팩트 뷰) 행 높이 고정 */
.compact-table tbody tr {
    height: 25px;
}

.compact-table .schedule-item {
    padding: 2px 4px;
    font-size: 9px;
    top: 1px;
    left: 1px;
    right: 1px;
    height: calc(100% - 2px);
}

.compact-table .schedule-icon {
    font-size: 10px;
    margin: 0;
}

.compact-table .schedule-time {
    display: none;
}

/* 리스트 뷰 */
.list-view {
    display: none;
}

.list-view.active {
    display: block;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 5px solid;
    transition: all 0.3s;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.schedule-card.event-checktime {
    border-left-color: #4ECDC4;
}

.schedule-card.event-photozone {
    border-left-color: #FF6B6B;
}

.schedule-card.event-autograph {
    border-left-color: #95E1D3;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    font-size: 2em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.event-checktime .card-icon {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.event-photozone .card-icon {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
}

.event-autograph .card-icon {
    background: linear-gradient(135deg, #95E1D3 0%, #7DD4C4 100%);
}

.card-title {
    flex: 1;
}

.card-title h3 {
    font-size: 1.3em;
    margin-bottom: 5px;
    color: #333;
}

.card-title .event-type {
    font-size: 0.9em;
    color: #666;
}

.card-time {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
}

.card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-info i {
    font-size: 1.2em;
    color: #667eea;
}

.card-info-text {
    font-size: 0.95em;
}

.card-info-label {
    color: #999;
    font-size: 0.85em;
    display: block;
}

.card-info-value {
    font-weight: 600;
    color: #333;
}

/* 버튼 */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95E1D3;
    color: #333;
}

.btn-secondary:hover {
    background: #7dd4c4;
}

/* 네비게이션 */
.navigation {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1em;
}

/* 반응형 디자인 */

/* 태블릿 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .header p {
        font-size: 0.95em;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
    }

    .date-selector {
        width: 100%;
    }

    .view-selector {
        width: 100%;
        justify-content: space-between;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .view-btn {
        flex: 1;
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .timetable th {
        font-size: 0.9em;
        padding: 10px 5px;
    }

    .time-cell {
        font-size: 0.85em;
        padding: 10px 5px;
    }

    .schedule-item {
        font-size: 0.85em;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-time {
        font-size: 1.2em;
    }
}

/* 모바일 (Galaxy S8 등) */
@media (max-width: 400px) {
    .container {
        padding: 15px 10px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.85em;
    }

    .operation-info {
        font-size: 0.95em;
        padding: 12px 15px;
    }

    .filter-btn {
        padding: 7px 12px;
        font-size: 0.85em;
    }

    .scroll-hint {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .compact-container {
        max-height: 420px;
    }

    .schedule-card {
        padding: 15px;
    }

    .card-icon {
        font-size: 1.5em;
        width: 40px;
        height: 40px;
    }

    .card-title h3 {
        font-size: 1.1em;
    }

    .card-time {
        font-size: 1em;
    }

    button {
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

/* 유틸리티 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* 자동 새로고침 표시 */
.auto-refresh {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.auto-refresh i {
    margin-right: 5px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
