/* ==========================================
   [통합] Panda & Soop 카드 그리드형 관리자 페이지 공통 CSS
   ========================================== */

/* === 다크모드 통합 및 프리미엄 스타일 변수 === */
:root {
    --primary: #4f46e5; 
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-sub: #6b7280;
    --border-color: #e5e7eb;
    --input-bg: #f9fafb;
    --error-color: #ef4444;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border-color: #334155;
    --input-bg: #0f172a;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* === 기본 설정 === */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { 
    font-family: 'Pretendard', sans-serif; 
    padding: 0; margin: 0; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    transition: background 0.3s, color 0.3s; 
    line-height: 1.6;
}

/* === 다크모드 토글 버튼 === */
.theme-toggle {
    position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    font-size: 1.6rem; padding: 8px; border-radius: 50%;
    z-index: 901; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.theme-toggle:hover { background-color: rgba(0,0,0,0.05); }
[data-theme="dark"] .theme-toggle:hover { background-color: rgba(255,255,255,0.1); }

/* === 사이드바 === */
.sidenav { 
    height: 100%; width: 0; position: fixed; z-index: 1500; top: 0; left: 0; 
    background-color: var(--card-bg); overflow-x: hidden; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    padding-top: 80px; box-shadow: var(--shadow-lg); border-right: 1px solid var(--border-color);
}
.sidenav a { 
    padding: 16px 30px; text-decoration: none; font-size: 1.4rem; 
    color: var(--text-main); display: block; transition: background-color 0.2s, color 0.2s; 
    font-weight: 800; letter-spacing: -0.02em;
}
.sidenav a:hover { background-color: var(--input-bg); color: var(--primary); }
.sidenav .closebtn { 
    position: absolute; top: 20px; right: 30px; font-size: 2.5rem; font-weight: 900; 
    margin: 0; padding: 0; cursor: pointer; color: var(--text-main); line-height: 1;
}
.sidenav .closebtn:hover { background-color: transparent; color: var(--primary); }
.sidenav-title { display: none; }

#user-info { padding: 30px; border-top: 1px solid var(--border-color); margin-top: 20px; }
#username-display { margin-bottom: 24px; color: var(--text-sub); font-size: 1.1rem; font-weight: 600; }
.nav-logout { color: var(--text-main) !important; font-weight: 900; font-size: 1.5rem; padding: 0 !important; display: block; }
.nav-logout:hover { color: var(--error-color) !important; background-color: transparent !important; }

/* === 헤더 === */
header { 
    background: var(--card-bg); padding: 20px 30px; text-align: center; position: sticky; top: 0; z-index: 900;
    border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-sm); 
}
.menu-icon { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); font-size: 28px; cursor: pointer; padding: 5px; color: var(--text-main); }
h2 { margin: 0; font-size: 1.3rem; color: var(--text-main); display: inline-block; font-weight: 800; letter-spacing: -0.01em; }

/* === 컨테이너 및 카드 박스 === */
.container { max-width: 1200px; margin: 40px auto; padding: 0 30px; }
.card-box {
    background: var(--card-bg); 
    border-radius: 0; /* 💡 0으로 변경 (직각) */
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color); margin-bottom: 32px; overflow: hidden;
}
.card-padding { padding: 32px; }
.card-header { margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.card-title { font-size: 1.3rem; font-weight: 800; color: var(--text-main); }

/* === 폼 (입력창) === */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px;}
.form-label { font-size: 1rem; font-weight: 700; color: var(--text-sub); }
.form-input, .form-select {
    padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; 
    font-size: 1.05rem; outline: none; transition: all 0.2s ease; 
    background-color: var(--input-bg); width: 100%; box-sizing: border-box; color: var(--text-main);
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15); background-color: var(--card-bg); }
.input-error { border-color: var(--error-color); background-color: rgba(239, 68, 68, 0.05); }
.validation-msg { background-color: var(--error-color); color: white; font-size: 0.85rem; margin-top: 8px; padding: 6px 12px; border-radius: 8px; font-weight: 700; display: none; width: fit-content; }
.btn-create {
    width: 100%; padding: 18px; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); 
    color: white; border: none; border-radius: 12px; font-size: 1.15rem; font-weight: 800; 
    cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-md); letter-spacing: 0.02em;
}
.btn-create:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-create:active { transform: translateY(0); }

/* === 검색 및 목록 헤더 === */
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; }
.search-container { display: flex; align-items: center; position: relative; width: 100%; max-width: 380px; }
.search-icon { cursor: pointer; position: absolute; top: 0; right: 0; width: 48px; height: 100%; z-index: 10; opacity: 0; }
.h3-search-input {
    width: 100%; padding: 14px 50px 14px 20px !important; font-size: 1.05rem !important; box-sizing: border-box;
    background-color: var(--input-bg); border: 1px solid var(--border-color); border-radius: 50px; 
    color: var(--text-main); transition: all 0.2s ease; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 25'%3e%3cpath fill='%239ca3af' d='M16.923 16.06a.7.7 0 0 0-.973 1.006l.973-1.007Zm2.887 4.74a.7.7 0 1 0 .974-1.006L19.81 20.8Zm-3.86-3.734 3.86 3.734.974-1.006-3.86-3.735-.974 1.007Z'/%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-width='1.5' d='M18.703 11.203a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 16px center; background-size: 22px 22px; 
}
.h3-search-input:focus { border-color: var(--primary); background-color: var(--card-bg); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.clear-icon { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #9ca3af; font-size: 18px; width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; display: none; z-index: 15; font-weight: bold; transition: color 0.2s; }
.clear-icon:hover { color: var(--text-main); }

/* === 뷰 모드 전환 버튼 === */
.btn-icon { width: 48px; height: 48px; padding: 0; margin: 0; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.btn-icon:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--input-bg); }

/* =========================================================
   [핵심] 리스트 컨테이너 (그리드 뷰 vs 리스트 뷰)
   ========================================================= */
.list-container { 
    background-color: var(--card-bg); 
    border-radius: 0; /* 💡 0으로 변경 (직각) */
    min-height: 200px;
}

/* 🗂️ 카드(그리드) 뷰 기본 설정 */
.list-container.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding: 28px; }
.list-container.view-grid .list-only { display: none !important; }
.list-container.view-grid .list-only-badge { display: none !important; }

/* 📋 컴팩트 리스트 뷰 설정 */
.list-container.view-list { display: flex; flex-direction: column; gap: 0; padding: 0; background-color: var(--card-bg); min-height: 50px; }
.list-container.view-list .file-li { flex-direction: row; border: none; border-bottom: 1px solid var(--border-color); border-radius: 0; box-shadow: none; padding: 12px 28px; align-items: center; height: auto; }
.list-container.view-list .file-li:hover { transform: none; background-color: var(--input-bg); box-shadow: none; }
.list-container.view-list .file-li:last-child { 
    border-bottom: none; 
    border-radius: 0; /* 💡 0으로 변경 */
}

/* 리스트 뷰 내부 요소 재배치 */
.list-container.view-list .thumb-wrap { display: none; } /* 썸네일 숨김 */
.list-container.view-list .file-num { display: block; font-size: 1.1rem; font-weight: 900; color: var(--text-sub); width: 30px; text-align: center; opacity: 0.7; margin-right: 16px; flex-shrink: 0; }
.list-container.view-list .card-info { flex: 1; padding: 0; gap: 4px; flex-direction: column; align-items: flex-start; justify-content: center; }
.list-container.view-list .b-name { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; white-space: normal; }
.list-container.view-list .b-id { font-size: 0.85rem; padding: 2px 6px; background: var(--bg-color); border-radius: 6px; display: inline-flex; margin-top: 2px; }
.list-container.view-list .card-actions { border: none; padding: 0; background: transparent; display: flex; gap: 10px; width: auto; align-items: center; }
.list-container.view-list .card-actions-right { display: flex; gap: 8px; }

/* === 개별 카드 아이템 공통 (view-grid 기반 뼈대) === */
.file-li { 
    display: flex; flex-direction: column; align-items: stretch;
    background: var(--card-bg); border: 1px solid var(--border-color); 
    border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease; position: relative;
}
.list-container.view-grid .file-li:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* 썸네일 영역 */
.thumb-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; cursor: pointer; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: transform 0.5s ease; } /* 💡 opacity를 1로 변경하고 불필요한 트랜지션 제거 */
.file-li:hover .thumb-img { transform: scale(1.05); } /* 💡 이미 밝으므로 확대 효과(scale)만 유지 */
.thumb-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 5; }
.thumb-viewers { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); color: white; padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: 800; z-index: 5; display: flex; align-items: center; gap: 6px; letter-spacing: 0.02em; }
.live-dot { color: #ef4444; font-size: 10px; animation: blink-badge 2s infinite ease-in-out; }

/* 카드 정보 텍스트 영역 */
.card-info { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.b-name { font-size: 1.15rem; font-weight: 900; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }

/* 👇 뱃지 스타일을 없애고 깔끔한 회색 텍스트로 변경 👇 */
.b-id { 
    font-size: 0.95rem; /* 글자 크기 약간 키움 */
    color: var(--text-sub); 
    font-family: 'Pretendard', sans-serif; 
    font-weight: 600; 
    cursor: pointer; 
    transition: color 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    gap: 4px; 
    margin-top: 2px;
}

/* 카드형에서는 변화 없고, 리스트형에서만 색상/밑줄 표시되도록 수정 */
.list-container.view-list .b-id:hover { 
    color: var(--primary); 
    text-decoration: underline; 
}

/* 하단 관리 버튼 영역 */
.card-actions { padding: 14px 20px; border-top: 1px solid var(--border-color); background: var(--input-bg); display: flex; justify-content: space-between; align-items: center; }
.card-actions-right { display: flex; gap: 8px; }
.btn-action { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-edit { background-color: var(--bg-color); color: var(--text-main); border: 1px solid var(--border-color); } 
.btn-edit:hover { background-color: var(--text-main); color: var(--card-bg); border-color: var(--text-main); transform: translateY(-2px); }
.btn-del { background-color: rgba(254, 242, 242, 0.6); color: #ef4444; border: 1px solid #fecaca; } 
.btn-del:hover { background-color: #ef4444; color: #ffffff; border-color: #ef4444; transform: translateY(-2px); }

/* === 뱃지 === */
.badge { font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; font-weight: 900; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; height: 22px; letter-spacing: 0.05em; }
.badge-live { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4); }
.badge-off { background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); color: white; border: 1px solid rgba(255,255,255,0.2); }
.badge-waiting { background-color: #64748b; color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
@keyframes blink-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.badge-live.recording { animation: blink-badge 2s infinite ease-in-out; }

/* === 토글 스위치 === */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .3s ease-in-out; border-radius: 34px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .3s ease-in-out; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary); box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
input:checked + .slider:before { transform: translateX(20px); }
.item-disabled .card-info, .item-disabled .thumb-wrap { opacity: 0.4; filter: grayscale(80%); }

/* === 페이지네이션 === */
.pagination-container { 
    display: flex; justify-content: center; align-items: center; gap: 8px; padding: 30px; 
    border-top: 1px solid var(--border-color); background: var(--card-bg); 
    border-radius: 0; /* 💡 0으로 변경 (직각) */
}
.page-btn { min-width: 42px; height: 42px; padding: 0 6px; border: 1px solid var(--border-color); background-color: var(--card-bg); color: var(--text-main); border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.page-btn:hover:not(:disabled) { background-color: var(--bg-color); border-color: var(--text-sub); }
.page-btn.active { background-color: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); }
.page-btn:disabled { color: var(--text-sub); opacity: 0.4; cursor: not-allowed; }

/* === 필터 버튼 === */
.filter-wrapper { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 5px; }
.filter-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-width: 90px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-sub); font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: var(--shadow-sm); }
.filter-btn:hover { transform: translateY(-2px); color: var(--text-main); box-shadow: var(--shadow-md); border-color: var(--text-sub); }
.filter-btn:active { transform: translateY(0); }
.f-icon { font-size: 1rem; line-height: 0; opacity: 0.9; }
.dot-live { color: #ef4444; font-size: 1.2rem; margin-bottom: 2px; }
.filter-btn.active { color: white; border: 1px solid transparent; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.filter-btn.btn-all.active { background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.filter-btn.btn-live.active { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); }
.filter-btn.btn-live.active .dot-live { color: white; }
.filter-btn.btn-wait.active { background: linear-gradient(135deg, #64748b, #334155); box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3); }
.filter-btn.btn-off.active { background: linear-gradient(135deg, #374151, #111827); box-shadow: 0 4px 12px rgba(17, 24, 39, 0.4); }

/* === 모달 (수정 & 정보) === */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.modal { background: var(--card-bg); padding: 40px; border-radius: 24px; width: 90%; max-width: 560px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); border: 1px solid var(--border-color); }
.modal-header { font-size: 1.5rem; font-weight: 800; margin-bottom: 28px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; color: var(--text-main); }
.modal-body { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
.modal-body label { font-weight: 800; font-size: 1.05rem; color: var(--text-sub); margin-bottom: 2px; display: block; }
.modal-body input { width: 100%; padding: 16px; border: 1px solid var(--border-color); border-radius: 12px; font-size: 1.1rem; box-sizing: border-box; outline: none; background-color: var(--input-bg); color: var(--text-main); transition: 0.2s; }
.modal-body input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.modal-body input[readonly] { background-color: var(--bg-color); color: var(--text-sub); opacity: 0.8; }
.modal-footer { display: flex; justify-content: flex-end; gap: 16px; }
.btn-cancel { background: var(--bg-color) !important; color: var(--text-sub) !important; border: 1px solid var(--border-color) !important; padding: 14px 28px !important; border-radius: 12px !important; cursor: pointer; font-weight: 700 !important; font-size: 1.05rem !important; transition: all 0.2s ease !important; }
.btn-cancel:hover { background-color: var(--border-color) !important; color: var(--text-main) !important; }
.btn-save { background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important; color: white !important; border: none !important; padding: 14px 28px !important; border-radius: 12px !important; cursor: pointer; font-weight: 700 !important; font-size: 1.05rem !important; box-shadow: var(--shadow-md) !important; transition: all 0.2s ease !important; }
.btn-save:hover { transform: translateY(-2px) !important; box-shadow: var(--shadow-lg) !important; }

/* 모달 상세 (정보 확인창용) */
.info-modal-img { width: 100%; border-radius: 16px; margin-bottom: 20px; aspect-ratio: 16 / 9; object-fit: cover; background-color: #000; box-shadow: var(--shadow-md); border: 1px solid var(--border-color); }
.info-modal-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; line-height: 1.4; word-break: break-all; }
.info-modal-nick { font-size: 1.1rem; color: var(--text-sub); display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-weight: 600; }
.info-badge-container { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; align-items: center; }
.info-badge { display: inline-flex !important; align-items: center; justify-content: center; padding: 6px 14px !important; border-radius: 50px !important; font-size: 0.9rem !important; font-weight: 800 !important; color: white !important; line-height: 1; box-shadow: var(--shadow-sm); height: 28px; }
.badge-status-live { background: #ef4444 !important; gap: 6px; box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4); }
.badge-status-offline { background: var(--text-sub) !important; }
.badge-rec-recording { background-color: #10b981 !important; }  
.badge-rec-waiting { background-color: #f59e0b !important; }    
.badge-rec-disabled { background-color: #9ca3af !important; }   
.live-sphere { width: 14px; height: 14px; background: radial-gradient(circle at 30% 30%, #ff8a8a, #ef4444 70%, #b91c1c); border-radius: 50%; box-shadow: inset -1px -1px 2px rgba(0,0,0,0.2); }
.live-separator { margin: 0 4px; opacity: 0.5; color: var(--border-color); }
.loading-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 0; min-height: 350px; }
.loading-gif { width: 80px; height: 80px; object-fit: contain; }

/* ==========================================
   뷰 모드 텍스트 전환 및 버튼 제어
   ========================================== */
/* 리스트 뷰 전용 텍스트 (그리드뷰에서 숨김) */
.list-container.view-grid .list-only-text { display: none !important; }

/* 그리드 뷰 전용 텍스트 (리스트뷰에서 숨김) */
.list-container.view-list .grid-only-text { display: none !important; }

/* 카드형(Grid) 뷰: 하단 영역을 썸네일 우측 상단으로 띄우고, 토글만 남김 */
.list-container.view-grid .card-actions { 
    display: block !important;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 10;
}
.list-container.view-grid .card-actions-right { 
    display: none !important; /* 수정/삭제 버튼만 숨김 */
}

/* ==========================================
   리스트 뷰에서만 방제 호버 시 색상 변경
   ========================================== */
.list-container.view-list .b-name {
    transition: color 0.2s ease;
}

.list-container.view-list .b-name:hover {
    color: var(--primary);
}


/* ==========================================
   카드형(Grid) 뷰: 빈 공간(여백) 클릭 시에도 방송국 이동되도록 영역 확장
   ========================================== */
.list-container.view-grid .card-info {
    position: relative;
    cursor: pointer;
}

.list-container.view-grid .b-name::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 방송시작 시간 (닉네임 라인 우측 정렬) */
.info-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub); /* 👈 이 부분을 수정했습니다 */
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0; 
    letter-spacing: -0.02em;
    white-space: nowrap; 
    flex-shrink: 0; 
}

/* 리스트 뷰에서 썸네일 시간 숨김 처리 */
.list-container.view-list .info-time { display: none !important; }

/* 리스트 뷰에서 썸네일 시간 숨김 처리 */
.list-container.view-list .info-time { display: none !important; }



/* === 더보기 (Load More) 버튼 (그리드뷰 전용) === */
.load-more-wrap {
    width: 100%;
    display: flex;
}

.btn-load-more {
    width: 100%; /* 👈 버튼을 가로 전체 영역으로 꽉 채웁니다 */
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    padding: 15px 0; /* 👈 위아래 클릭 영역도 넉넉하게 확보 */
    transition: all 0.2s ease;
    display: flex;
    justify-content: center; /* 글자는 가운데 정렬 */
    align-items: center;
    letter-spacing: -0.02em;
    border-radius: 8px; /* 호버 시 예쁘게 보이도록 모서리 라운드 처리 */
}

.btn-load-more:hover {
    color: var(--primary);
    background-color: var(--input-bg); /* 👈 마우스를 올리면 전체 영역에 옅은 배경색이 표시됨 */
}



/* === 모바일 대응 === */
@media (max-width: 768px) {
    .container { padding: 0 10px; margin-top: 15px; }
    .card-box { border-radius: 16px; margin-bottom: 20px; }
    .card-padding { padding: 15px; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .list-header { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
    .search-container { max-width: 100%; }
    .list-title { display: none; }
    .integrated-header {
    background: var(--card-bg); padding: 20px 28px; font-weight: 800; color: var(--text-main); 
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.05rem; letter-spacing: -0.01em; border-bottom: 1px solid var(--border-color);
    border-radius: 0; /* 💡 혹시나 남아있을 둥글기 제거 */
}
    .integrated-header span[style*="border-radius"] { padding: 4px 8px !important; margin-right: 0 !important; }
    
    .filter-wrapper { flex-wrap: nowrap; justify-content: space-between; gap: 4px; padding: 0; }
    .filter-btn { min-width: 0; flex: 1; padding: 0 2px; font-size: 0.8rem; height: 38px; white-space: nowrap; letter-spacing: -0.05em; }

    /* 카드(Grid) 뷰일 때 모바일: 1열로 세로 나열 */
    .list-container.view-grid { grid-template-columns: 1fr; gap: 16px; padding: 16px; }

    /* 리스트(List) 뷰일 때 모바일: 극한으로 압축된 1줄 형태 */
    .list-container.view-list .file-li { padding: 12px 10px; gap: 6px; }
    .list-container.view-list .file-num { width: 18px; font-size: 1rem; margin: 0; text-align: left; margin-right: 8px; }
    .list-container.view-list .card-info { min-width: 0; gap: 2px; }
    .list-container.view-list .b-name { font-size: 0.95rem; flex-wrap: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .list-container.view-list .b-id { font-size: 0.75rem; padding: 1px 4px; margin-top: 0; }
    .list-container.view-list .badge { transform: scale(0.85); transform-origin: left center; margin: 0; }
    .list-container.view-list .card-actions { flex-direction: row; gap: 6px; }
    .list-container.view-list .card-actions-right { gap: 4px; }
    .list-container.view-list .btn-action { padding: 6px 8px; font-size: 0.75rem; border-radius: 6px; }
    .list-container.view-list .switch { width: 36px; height: 20px; }
    .list-container.view-list .slider:before { height: 14px; width: 14px; left: 3px; bottom: 3px; }
    input:checked + .list-container.view-list .slider:before { transform: translateX(16px); }
}