/* ============================================
   Base Layout Styles
   ============================================ */

/* ============================================
   전역 색상 변수 시스템
   ============================================ */
:root {
    /* 팀 색상 */
    --team-blue: #4299E1;
    --team-red: #F56565;
    --team-blue-text: #4299E1;
    --team-red-text: #F56565;
    
    /* 상태 색상 */
    --color-success: #16A34A;  /* 승리, 점수 증가 */
    --color-danger: #D97706;    /* 패배, 점수 하락 (주황색 - 블루/레드와 구분) */
    
    /* 액센트 색상 (버튼, section-title 등) */
    --color-accent: #1E293B;    /* 짙은 네이비색 */
    --color-accent-hover: #0F172A;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans KR", sans-serif;
}

/* ============================================
   헤더 - 고정 및 다크 네이비/그레이 배경
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-light {
    background-color: #0B1220 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    padding: 0.875rem 0;
}

.navbar-light .navbar-brand {
    display: flex;
    align-items: center;
    margin-right: 2rem;
    padding: 0;
}

.navbar-light .navbar-brand:hover {
    opacity: 0.9;
}

.navbar-light .navbar-brand svg {
    display: block;
}

.navbar-light .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-item {
    min-width: 56px !important;
    text-align: center !important;
}

.navbar-nav {
    gap: 16px;
}

/* 탭 메뉴 스타일 */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.125rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.navbar-light .navbar-toggler {
    border-color: #E2E8F0;
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2826, 26, 26, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 헤더 검색 - 우측에 위치, 크기와 여백으로 강조 */
.header-search-wrapper {
    position: relative;
    margin-left: auto;
    margin-right: 1rem;
    min-width: 320px;
    max-width: 450px;
}

.header-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9375rem;
    z-index: 2;
}

.header-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.9375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.2s;
    font-weight: 400;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-search-input:focus {
    outline: none;
    border-color: #3B82F6;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.header-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-result-item {
    display: block;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #E2E8F0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #F7FAFC;
    text-decoration: none;
    color: inherit;
}

.search-result-name {
    font-weight: 600;
    color: #1A202C;
    font-size: 0.9375rem;
}

.search-result-meta {
    font-size: 0.875rem;
    color: #4A5568;
    margin-top: 0.25rem;
}

.search-result-empty {
    padding: 1.25rem;
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
}

.navbar-light .dropdown-toggle {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
}

.navbar-light .dropdown-toggle:hover {
    color: white !important;
}

.navbar-light .dropdown-menu {
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
}

.navbar-light .nav-login-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
}

.navbar-light .nav-login-link:hover {
    color: white !important;
}

/* ============================================
   Main Layout Container - Flex Layout
   ============================================ */
.main-layout-container {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-xl, 2rem) var(--spacing-md, 1rem);
    align-items: flex-start;
}

/* ============================================
   Sidebar (Banners)
   ============================================ */
.sidebar {
    position: sticky;
    top: calc(78px + var(--spacing-md, 1rem));
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 1rem);
    max-height: calc(100vh - 78px - var(--spacing-md, 1rem));
    overflow-y: auto;
    z-index: 10;
    margin-top: 24px;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 2px;
}

.sidebar-left {
    order: 1;
}

.sidebar-right {
    order: 3;
}

/* ============================================
   Main Content Area
   ============================================ */
main {
    flex: 1;
    min-width: 0;
    order: 2;
    max-width: 1080px;
    margin: 0 auto;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1520px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 992px) {
    .header-search-wrapper {
        max-width: 100%;
        margin: 0.75rem 0;
        min-width: auto;
        width: 100%;
    }
    
    .main-layout-container {
        padding: var(--spacing-md, 1rem);
    }
}

/* ============================================
   Common Components
   ============================================ */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
}

.stat-card p {
    opacity: 0.9;
    margin-bottom: 0;
}

.game-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    transition: transform 0.2s;
}

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

.player-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.kda-display {
    font-weight: bold;
}

.kda-good { color: #28a745; }
.kda-average { color: #ffc107; }
.kda-bad { color: #dc3545; }

.confidence-badge {
    font-size: 0.8rem;
}

.screenshot-preview {
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
}

.filter-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}
