/* 페이지 전환을 위한 전역 설정 */
:root {
    --page-opacity: 1;
}

/* 브라우저 기본 배경색 강제 덮어쓰기 */
* {
    box-sizing: border-box;
}

html, body {
    background-color: #181c1f !important;
    background: #181c1f !important;
}

/* 초기 페이지 로딩 상태 */
html {
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 페이지 전환 효과 */
body {
    opacity: 1;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #181c1f !important;
    color: #eee;
}
body.fade-out {
    opacity: 0;
}

/* 페이지 전환 효과 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #181c1f; /* 페이지 배경색과 동일 */
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out; /* 더 빠른 전환 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* 페이지 전환 로딩 표시 */
.page-transition::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(238, 238, 238, 0.1);
    border-top: 3px solid #6cf;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 아코디언 세션 상세 */
.session-row.expandable {
    cursor: pointer;
    transition: background-color 0.2s;
}
.session-row.expandable:hover {
    background-color: #25292d;
}
.session-detail-row {
    background: #23272b;
    transition: background 0.2s;
}
.session-detail-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    will-change: max-height, opacity;
    padding-top: 0;
    padding-bottom: 0;
    /* JavaScript가 transition을 동적으로 제어 */
}
.session-detail-row.open .session-detail-content {
    overflow-y: auto;
    /* 스크롤바 스타일링 */
    scrollbar-width: thin;
    scrollbar-color: #6cf #23272b;
}
.session-detail-row.open .session-detail-content::-webkit-scrollbar {
    width: 8px;
}
.session-detail-row.open .session-detail-content::-webkit-scrollbar-track {
    background: #23272b;
    border-radius: 4px;
}
.session-detail-row.open .session-detail-content::-webkit-scrollbar-thumb {
    background: #6cf;
    border-radius: 4px;
    border: 1px solid #23272b;
}
.session-detail-row.open .session-detail-content::-webkit-scrollbar-thumb:hover {
    background: #4ad;
}
.session-detail-table {
    width: 100%;
    margin: 8px 0 0 0;
    border-collapse: collapse;
    background: #23272b;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0002;
}
.session-detail-table th, .session-detail-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #222;
    text-align: center;
}
.session-detail-table th {
    background: #181c1f;
    color: #6cf;
    font-weight: 600;
}
.session-detail-table tr:last-child td {
    border-bottom: none;
}
.map-name.clickable:hover {
    color: #fff;
    background: #6cf2;
    text-shadow: 0 0 2px #6cf, 0 0 8px #6cf2;
}
/* --- Modern Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0 0 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-block;
    min-width: 36px;
    padding: 8px 14px;
    border-radius: 6px;
    background: #23272b;
    color: #6cf;
    font-weight: 600;
    font-size: 1.08em;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px #0002;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    border: 1px solid #333;
    margin: 0 2px;
    cursor: pointer;
}
.pagination a:hover {
    background: #6cf;
    color: #181c1f;
    box-shadow: 0 4px 16px #6cf2;
}
.pagination .active, .pagination span.active {
    background: linear-gradient(90deg,#4ad,#6cf);
    color: #181c1f;
    font-weight: 700;
    border: 1.5px solid #6cf;
    box-shadow: 0 4px 16px #6cf4;
    cursor: default;
}
.pagination .dots {
    background: transparent;
    color: #888;
    border: none;
    box-shadow: none;
    cursor: default;
    font-weight: bold;
    padding: 8px 6px;
}
.pagination .dots:hover {
    background: transparent;
    color: #888;
    box-shadow: none;
}

.sort-buttons {
    margin-bottom: 20px;
    text-align: right;
}

.sort-btn {
    padding: 10px 18px;
    margin: 0 6px;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #2a2e33;
    color: #ccc;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.sort-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 204, 255, 0.1), transparent);
    transition: left 0.5s;
}

.sort-btn:hover {
    background: #343a40;
    border-color: #6cf;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 204, 255, 0.2);
}

.sort-btn:hover::before {
    left: 100%;
}

.sort-btn.active {
    background: linear-gradient(135deg, #6cf, #5be);
    border-color: #6cf;
    color: #000;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(102, 204, 255, 0.3);
}

.sort-btn.active:hover {
    background: linear-gradient(135deg, #5be, #4ad);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 204, 255, 0.4);
}

@media (max-width: 900px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; min-height: unset; flex-direction: row; padding: 0 0 0 0; box-shadow: none; }
    .sidebar ul { display: flex; flex-direction: row; gap: 16px; padding: 0 0 0 16px; }
    .main-content { padding: 18px 8px; }
    table { font-size: 0.98em; }
    
    .sort-btn {
        padding: 8px 14px;
        margin: 0 4px;
        font-size: 13px;
    }
}
@media (max-width: 600px) {
    .sidebar { flex-direction: column; }
    .sidebar ul { flex-direction: column; gap: 0; padding: 0 0 0 12px; }
    .main-content { padding: 8px 2px; }
    table { font-size: 0.93em; }
    th, td { padding: 7px 6px; }
    .search-bar { flex-direction: column; gap: 6px; }
    .search-bar input[type=text] { width: 100%; }
    
    .sort-buttons {
        margin-bottom: 15px;
    }
    
    .sort-btn {
        padding: 8px 12px;
        margin: 2px;
        font-size: 12px;
        display: block;
        width: calc(50% - 8px);
        margin: 4px 2px;
        display: inline-block;
        text-align: center;
    }
}
/* 플레이어 레이어 버튼 스타일 */
#player-layer button {
    background: #6cf;
    color: #181c1f;
    border: none;
    border-radius: 4px;
    padding: 8px 0;
    margin-bottom: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
#player-layer button:hover {
    background: #4ad;
}
body { font-family: Arial, sans-serif; background: #181c1f; color: #eee; }
.container { display: flex; }
.sidebar {
    width: 220px;
    background: #202428;
    min-height: 100vh;
    padding: 24px 0 0 0;
    box-shadow: 2px 0 8px #0002;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.sidebar h2 {
    color: #6cf;
    font-size: 1.2em;
    margin: 0 0 12px 24px;
}
.sidebar ul {
    list-style: none;
    padding: 0 0 0 24px;
    margin: 0 0 24px 0;
}
.sidebar li {
    margin-bottom: 10px;
}
.sidebar a {
    color: #eee;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}
.sidebar a:hover {
    color: #6cf;
}
.main-content {
    flex: 1;
    padding: 32px 48px;
}
.search-bar {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}
.search-bar input[type=text] {
    padding: 8px;
    width: 220px;
    border-radius: 4px;
    border: none;
    background: #23272b;
    color: #eee;
}
.search-bar button {
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    background: #6cf;
    color: #181c1f;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.search-bar button:hover {
    background: #4ad;
}

/* --- Modern Table & Link Styles --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2em;
    background: rgba(30,34,38,0.98);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px #0002;
}
th, td {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2e33;
    font-size: 1.05em;
    text-align: center;
}

/* 텍스트 컬럼은 왼쪽 정렬 */
td.text-left, th.text-left {
    text-align: left;
    padding-left: 20px;
}

/* 숫자 컬럼은 중앙 정렬 (기본값) */
td.text-center, th.text-center {
    text-align: center;
}
th {
    background: #23272b;
    color: #6cf;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #4ad;
}
tr:last-child td {
    border-bottom: none;
}
a {
    color: #6cf;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.18s;
}
a:hover {
    color: #4ad;
    text-shadow: 0 0 6px #6cf8;
}

/* 스크롤 영역 공통 스타일 */
.scroll-container {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6cf #23272b;
}
.scroll-container::-webkit-scrollbar {
    width: 8px;
}
.scroll-container::-webkit-scrollbar-track {
    background: #23272b;
    border-radius: 4px;
}
.scroll-container::-webkit-scrollbar-thumb {
    background: #6cf;
    border-radius: 4px;
    border: 1px solid #23272b;
}
.scroll-container::-webkit-scrollbar-thumb:hover {
    background: #4ad;
}
