/* =========================================
   [기본 설정 (다크 모드 기본)] 
   ========================================= */
body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Arial', sans-serif;
    background-color: #1a1a1a;
    color: white;
    margin: 0;
    padding: 20px;
    text-align: center;
    transition: background-color 0.3s, color 0.3s; /* 부드러운 테마 전환 */
}

h1 {
    font-family: 'Impact', 'Arial Black', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #f1c40f;
    font-size: 42px;
}

.subtitle {
    color: #aaa;
    margin-bottom: 30px;
    font-weight: 300;
}

/* =========================================
   [컨트롤 영역 & 드래프트 옵션] 
   ========================================= */
.controls {
    margin-bottom: 30px;
    padding: 25px;
    background: #252525;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: background 0.3s;
}

/* 드래프트 모드 선택 영역 */
.draft-options {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: white;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
    font-size: 14px;
}
.mode-select:focus { outline: 2px solid #f1c40f; }

.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 버튼 공통 스타일 (모던 디자인) */
button {
    border: none;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50px; /* 둥근 알약 모양 */
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

/* 비활성화(Disabled) 버튼 스타일 */
button:disabled {
    background: #444 !important;
    color: #777 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

/* [각 버튼별 컬러링 - 그라데이션 적용] */
.btn-draft {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #1a1a1a; 
}
.btn-draft:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.btn-next {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    display: none; /* 기본 숨김 */
}
.btn-next:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219150 100%);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4); 
}

.btn-reset {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}
.btn-reset:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-history {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}
.btn-history:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
}

/* 픽 상태 알림 메시지 (Ready to Draft) */
.pick-status {
    margin-top: 20px;
    font-size: 24px;
    font-weight: 800;
    color: #f1c40f;
    min-height: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

.stats {
    margin-top: 10px;
    font-size: 15px;
    color: #ccc;
    font-weight: 400;
}

/* =========================================
   [결과 화면 레이아웃 (RAW vs SD)] 
   ========================================= */
.brands-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    align-items: flex-start;
}

.brand-box {
    flex: 1;
    min-width: 320px;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #444;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: background 0.3s, border 0.3s;
}

.raw-header, .smackdown-header {
    padding: 15px;
    font-size: 26px;
    font-family: 'Impact', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    letter-spacing: 1px;
    color: white; 
}
.raw-header { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.smackdown-header { background: linear-gradient(135deg, #3498db, #2980b9); }

.roster-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    max-height: 600px;
    overflow-y: auto;
}

.roster-list li {
    padding: 12px 18px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #222;
    transition: background 0.2s;
}
.roster-list li:hover { background-color: #2a2a2a; }
.roster-list li:last-child { border-bottom: none; }
.roster-list span { font-size: 15px; font-weight: 400; }

/* 태그팀/스테이블 그룹 스타일 */
.team-group {
    background-color: #2a2a2a;
    border-bottom: 1px solid #444;
    padding: 12px 18px;
    transition: background 0.3s;
}
.team-name {
    color: #f1c40f;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    padding-left: 10px;
    font-size: 14px;
    color: #ddd;
    border-left: 2px solid #555;
    margin-top: 2px;
}

.gender-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}
.male { background-color: #444; color: #ccc; }
.female { background-color: #9b59b6; color: white; }

/* =========================================
   [팝업 및 히스토리 관리 스타일] 
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1e1e1e;
    margin: 3% auto;
    padding: 0;
    border: 1px solid #f1c40f;
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: background 0.3s;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    border-radius: 12px 12px 0 0;
    transition: background 0.3s;
}
.modal-header h2 { margin: 0; font-size: 22px; color: white; font-weight: 600; }

.close {
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close:hover { color: #f1c40f; }

/* 히스토리 컨트롤 바 (체크박스/삭제) */
.history-controls {
    padding: 10px 20px;
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}
.select-all-label {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ddd;
}
.history-actions { display: flex; gap: 10px; }

/* 미니 버튼 (삭제 등) */
.btn-mini {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: none;
    background: #555;
    color: white;
}
.btn-delete-sel:hover { background-color: #666; }
.btn-delete-all { background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); }
.btn-delete-all:hover { background: linear-gradient(135deg, #a93226 0%, #922b21 100%); }

/* 리스트 영역 */
#history-list { flex: 1; overflow-y: auto; padding: 20px; }

/* 아코디언 아이템 */
.accordion-item {
    margin-bottom: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    transition: background 0.3s;
}

.accordion-header {
    padding: 15px 15px 15px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
    background: #2a2a2a;
}
.accordion-header:hover { background-color: #333; }

.history-checkbox { width: 18px; height: 18px; cursor: pointer; }
.accordion-title { font-weight: 600; color: #f1c40f; font-size: 16px; flex: 1; }

.accordion-content {
    display: none;
    padding: 20px;
    background-color: #181818;
    border-top: 1px solid #333;
}

/* 히스토리 내부 박스 레이아웃 */
.history-layout { display: flex; gap: 20px; flex-wrap: wrap; }

.history-brand-box {
    flex: 1;
    min-width: 300px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}

.history-header {
    padding: 10px 15px;
    font-size: 18px;
    font-family: 'Impact', sans-serif;
    text-align: center;
    color: white;
}
.h-raw { background-color: #c0392b; }
.h-sd { background-color: #2980b9; }

.history-roster-list { list-style: none; padding: 0; margin: 0; }
.history-roster-list li {
    padding: 8px 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #ddd;
    background: #222;
}
.history-roster-list .team-group {
    padding: 8px 15px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
}

/* =========================================
   [★ 원형 3D 플로팅 테마 버튼] 
   ========================================= */
.floating-theme-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: #f1c40f; /* 다크모드일 때 버튼색 (골드) */
    color: #1a1a1a;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.5), 
                inset 0 -4px 0 rgba(0,0,0,0.2);
    z-index: 9999;
    transition: transform 0.1s, background-color 0.3s, bottom 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 4px;
}

.floating-theme-btn:hover {
    transform: translateY(-3px);
    background-color: #d4ac0d;
}

.floating-theme-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), 
                inset 0 -2px 0 rgba(0,0,0,0.1);
}

/* =========================================
   [☀️ 라이트 모드 스타일 (Light Mode)]
   ========================================= */
body.light-mode {
    background-color: #f4f4f4;
    color: #333;
}

body.light-mode .subtitle { color: #666; }
body.light-mode .stats { color: #555; }
body.light-mode .pick-status { 
    color: #d35400; 
    text-shadow: none; /* 라이트모드에선 글로우 제거 */
}

body.light-mode .controls {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.light-mode .mode-select {
    background-color: white;
    color: #333;
    border: 1px solid #ccc;
}

body.light-mode button:disabled {
    background: #e0e0e0 !important;
    color: #aaa !important;
}

body.light-mode .brand-box {
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

body.light-mode .roster-list li {
    background-color: white;
    border-bottom: 1px solid #eee;
    color: #333;
}
body.light-mode .roster-list li:hover { background-color: #f9f9f9; }

body.light-mode .team-group {
    background-color: #fcfcfc;
    border-bottom: 1px solid #eee;
}
body.light-mode .team-member {
    color: #555;
    border-left: 2px solid #ccc;
}

/* 라이트 모드에서의 플로팅 버튼 */
body.light-mode .floating-theme-btn {
    background-color: #333; /* 버튼색 */
    color: #f1c40f; /* 아이콘색 */
    box-shadow: 0 6px 15px rgba(0,0,0,0.3), 
                inset 0 -4px 0 rgba(255,255,255,0.1);
}
body.light-mode .floating-theme-btn:hover { background-color: #444; }

/* 라이트 모드에서의 모달/히스토리 */
body.light-mode .modal { background-color: rgba(0,0,0,0.5); }
body.light-mode .modal-content {
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
body.light-mode .modal-header {
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}
body.light-mode .modal-header h2 { color: #333; }
body.light-mode .close { color: #888; }
body.light-mode .history-controls {
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}
body.light-mode .select-all-label { color: #333; }

body.light-mode .accordion-item {
    background: white;
    border: 1px solid #ddd;
}
body.light-mode .accordion-header { background: #f1f1f1; }
body.light-mode .accordion-header:hover { background: #e9e9e9; }
body.light-mode .accordion-title { color: #d35400; }

body.light-mode .accordion-content {
    background-color: #fafafa;
    border-top: 1px solid #ddd;
}
body.light-mode .history-brand-box {
    background: white;
    border: 1px solid #ddd;
}
body.light-mode .history-roster-list li,
body.light-mode .history-roster-list .team-group {
    background: white;
    color: #333;
    border-bottom: 1px solid #eee;
}