/* 전체 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 로그인 */
#loginPage {
    justify-content: flex-start;
    padding-left: 70%;
}

#loginPage .login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    color: #333;
    transform: translateX(-50%);
}

.login-box .form-label {
    color: #333 !important;
}

.login-box h2 {
    color: #0f3460;
    font-weight: bold;
}

/* 경매 게임 화면 레이아웃 - 가로 정렬 */
#auctionPage {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    background: linear-gradient(135deg, #0a192f 0%, #1a365d 100%);
    min-height: 100vh;
    width: 100%;
}

/* 좌측 팀목록: 35% */
#auctionPage .auction-sidebar {
    flex: 0 0 35% !important;
    width: 35%;
    height: 900px;
}

/* 중앙 메인 선수 블록: 30% */
#auctionPage .auction-main {
    flex: 0 0 30% !important;
    width: 30%;
    height: 900px;
}

/* 우측 경매순서: 35% */
#auctionPage .auction-sidebar-right {
    flex: 0 0 35% !important;
    width: 35%;
    height: 900px;  /* auction-main과 동일한 높이 */
}

/* 좌측 팀 사이드바 */
.auction-sidebar {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    height: 900px;
}

.team-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
}

.team-card:hover {
    border-color: rgba(59, 130, 246, 0.8);
    transform: translateY(-2px);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.team-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #3b82f6;
}

.team-points {
    font-size: 0.9rem;
    color: #fbbf24;
}

.team-members {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* 팀 멤버 그리드 (카드 형태) - 가로 배치 */
.team-members-grid {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.team-member-card {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 70px;
    flex-shrink: 0;
}

.team-member-card:hover {
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.team-member-card.captain {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.team-member-card.captain:hover {
    border-color: rgba(239, 68, 68, 0.8);
}

.team-member-card.empty {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.member-card-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 6px;
    border: 2px solid rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-member-card.captain .member-card-image {
    border-color: rgba(239, 68, 68, 0.6);
}

.member-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card-image .empty-slot {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.member-card-name {
    font-size: 0.75rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-word;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-card-badge {
    margin-top: 4px;
}

.member-card-badge .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* 팀 멤버 그리드 스크롤바 스타일 */
.team-members-grid::-webkit-scrollbar {
    height: 6px;
}

.team-members-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.team-members-grid::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 10px;
}

.team-members-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

.member-slot {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.member-slot.filled {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

/* 중앙 메인 영역 */
.auction-main {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 20px;
    border: 3px solid rgba(59, 130, 246, 0.4);
}

.auction-header {
    padding: 20px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 15px;
    margin-bottom: 30px;
}

/* 선수 카드 */
.player-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.player-image-container {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
}

.player-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
}

.player-image-container[style*="cursor: pointer"] {
    border-color: rgba(251, 191, 36, 0.8);
}

.player-image-container[style*="cursor: pointer"]:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#playerName {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 15px 0 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#playerPosition {
    font-size: 1rem;
    color: #fbbf24;
    font-weight: bold;
    margin-bottom: 15px;
}

.bid-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin: 30px 0;
}

.bid-info h4 {
    font-size: 1.8rem;
    color: #10b981;
    margin-bottom: 10px;
}

.bid-info p {
    font-size: 1.2rem;
    color: #fbbf24;
    margin: 0;
}

#currentBidder {
    font-weight: bold;
    color: #fbbf24;
    font-size: 1.3rem;
}

/* 다음 순서 선수들 */
.next-players {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.next-player-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.next-player-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
}

.next-player-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59, 130, 246, 0.4);
    margin-bottom: 5px;
}

/* 우측 선수 목록 사이드바 */
.auction-sidebar-right {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    height: 900px;  /* 좌측과 동일한 높이 */
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;  /* 전체는 스크롤 없음 */
}

/* 경매 순서 섹션 (상단 50%) */
.player-queue-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.player-queue-section h5 {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.player-queue-section #playerQueue {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    align-content: start;
}

/* 유찰 선수 섹션 (하단 50%) */
.unsold-players-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(239, 68, 68, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.unsold-players-section h5 {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.unsold-players-section #unsoldPlayersList {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    align-content: start;
}

.unsold-players-section #unsoldPlayersEmpty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-queue-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    padding: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.player-queue-card .queue-number {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.player-queue-card img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid rgba(59, 130, 246, 0.4);
}

.player-queue-card .fw-bold {
    font-size: 0.85rem;
    margin-bottom: 4px;
    word-break: break-word;
    color: #fff;
}

.player-queue-card .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

.player-queue-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
}

.player-queue-card.current {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
    animation: pulse 2s infinite;
}

.player-queue-card.current .queue-number {
    background: #fbbf24;
    color: #000;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.queue-number {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

/* 타이머 애니메이션 */
#timer {
    font-weight: bold;
    font-size: 1.2rem;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.timer-warning #timer {
    color: #ef4444;
    animation: blink 1s infinite;
}

/* 입찰 컨트롤 */
#bidControls .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.4);
    color: #fff;
    font-size: 1.2rem;
}

#bidControls .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

#bidControls .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    font-weight: bold;
    font-size: 1.1rem;
}

#bidControls .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

/* 포지션 배지 */
.position-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin: 0 5px;
}

.position-TOP { background: #ef4444; }
.position-JUNGLE { background: #10b981; }
.position-MID { background: #3b82f6; }
.position-ADC { background: #f59e0b; }
.position-SUPPORT { background: #8b5cf6; }

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* 반응형 */
@media (max-width: 1400px) {
    #auctionPage {
        flex-wrap: wrap;
    }
    
    #auctionPage .auction-sidebar,
    #auctionPage .auction-main,
    #auctionPage .auction-sidebar-right {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* 관리자 페이지 */
#adminPage {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
}

#adminPage .card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    color: #333;
}

/* 모달 및 카드 내부의 form-label 색상 */
.modal .form-label,
.card .form-label,
#adminPage .form-label {
    color: #333 !important;
}

.modal,
.card {
    color: #333;
}

.modal-body,
.card-body {
    color: #333;
}

/* 프로필 페이지 */
#profilePage {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
}

#profilePage .card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #333;
}

#profilePage .form-label {
    color: #333 !important;
}

/* 버튼 호버 효과 */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 결과 페이지 */
#resultPage {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    padding: 20px;
}

#resultPage .card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    color: #333;
}

#resultPage .card-header {
    font-weight: bold;
}

.stat-item h2 {
    font-weight: bold;
    margin: 10px 0;
}

.stat-item h5 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.result-team-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.result-team-card h4 {
    color: #0f3460;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* 사용자 테이블 스타일 */
#userTable tbody td {
    vertical-align: middle;
}

#userTable thead th.sortable {
    user-select: none;
    position: relative;
}

#userTable thead th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#userTable thead th.sortable span {
    margin-left: 5px;
    font-size: 0.8em;
}

#bidHistoryList .border-bottom:last-child {
    border-bottom: none !important;
}
