/* ============================================
   ATLAS - 특강 출강 지도
   Midnight Blue & Bronze Design System
   ============================================ */

/* Google Fonts - Serif for classic map feel */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Custom Properties - ATLAS Theme */
:root {
    /* Primary Colors - Midnight Blue */
    --primary-gradient: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%);
    --primary-dark: #0d1b2a;
    --primary-light: #415a77;
    --navy-deep: #0d1b2a;
    --navy-mid: #1b263b;
    --navy-light: #415a77;

    /* Bronze Accent Colors */
    --gold-primary: #cd7f32;
    --gold-light: #d4a373;
    --gold-dark: #a0522d;
    --gold-gradient: linear-gradient(135deg, #cd7f32 0%, #d4a373 50%, #cd7f32 100%);

    /* Warm Neutrals - Parchment/Cream */
    --cream-light: #f0ebe3;
    --cream-mid: #e6dfd5;
    --cream-dark: #cdc4b7;
    --parchment: #f5f2ed;

    /* Ocean/Exploration Colors */
    --ocean-deep: #1b263b;
    --ocean-mid: #415a77;
    --ocean-light: #778da9;
    --accent-copper: #b87333;
    --accent-bronze: #cd7f32;

    /* Status Colors */
    --success: #5a7c65;
    --success-light: #7a9b85;

    /* Glass Effect - Warm tinted */
    --glass-cream: rgba(245, 242, 237, 0.92);
    --glass-light: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(205, 127, 50, 0.2);

    /* Background Colors */
    --bg-primary: #0d1b2a;
    --bg-secondary: #1b263b;
    --bg-tertiary: #415a77;
    --surface: #f5f2ed;
    --surface-hover: #f0ebe3;

    /* Text Colors */
    --text-primary: #1b263b;
    --text-secondary: #4a5568;
    --text-muted: #6b7c8f;
    --text-light: #f0ebe3;
    --text-gold: #cd7f32;

    /* Shadows - Midnight toned */
    --shadow-sm: 0 1px 3px rgba(13, 27, 42, 0.12);
    --shadow-md: 0 4px 20px rgba(13, 27, 42, 0.18);
    --shadow-lg: 0 10px 40px rgba(13, 27, 42, 0.22);
    --shadow-xl: 0 20px 60px rgba(13, 27, 42, 0.28);
    --shadow-gold: 0 0 30px rgba(205, 127, 50, 0.25);
    --shadow-card: 0 8px 32px rgba(13, 27, 42, 0.14);
    --shadow-inset: inset 0 2px 4px rgba(13, 27, 42, 0.12);

    /* Border Radius - Slightly softer */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--cream-mid);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(26, 42, 58, 0.03) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================
   Header - ATLAS Cartographic Design
   ============================================ */
.header {
    position: relative;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    padding: 0;
    overflow: hidden;
    border-bottom: 3px solid var(--gold-primary);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 15% 50%, rgba(201, 162, 39, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 50%, rgba(201, 162, 39, 0.05) 0%, transparent 35%);
    pointer-events: none;
}

/* Latitude/Longitude grid pattern */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(201, 162, 39, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 162, 39, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    opacity: 0.8;
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 1.25rem 2rem;
    text-align: center;
}

.header h1 {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cream-light);
    letter-spacing: 0.08em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.header-logo {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.header-title {
    text-transform: uppercase;
}

.header-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    color: var(--gold-light);
    letter-spacing: 0.08em;
    font-weight: 400;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--gold-primary);
}

.header-decoration {
    position: relative;
    height: 4px;
    background: var(--gold-gradient);
    box-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}

/* ============================================
   Dashboard Bar - Horizontal Layout Below Header
   ============================================ */
.dashboard-bar {
    background: var(--parchment);
    border-bottom: 2px solid var(--navy-mid);
    box-shadow: var(--shadow-md);
    overflow: visible;
}

.dashboard-bar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* 대학교 달성률 */
.dashboard-bar .university-achievement-section {
    margin-bottom: 0;
    height: auto;
    padding: 1rem 1.25rem;
    flex-shrink: 0;
}

.dashboard-bar .achievement-ring {
    width: 80px;
    height: 80px;
}

.dashboard-bar .achievement-rate {
    font-size: 1.3rem;
}

.dashboard-bar .achievement-title {
    font-size: 0.95rem;
}

.dashboard-bar .achievement-detail {
    font-size: 0.8rem;
}

/* 통계 패널 */
.dashboard-bar .stats-panel {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    align-items: stretch;
    flex-shrink: 0;
}

.dashboard-bar .stat-item {
    min-width: 80px;
    padding: 0.75rem 1rem;
}

.dashboard-bar .stat-number {
    font-size: 1.6rem;
}

.dashboard-bar .stat-label {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

/* 차트 섹션들 - 행 형태 배치 */
.dashboard-bar .charts-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.dashboard-bar .chart-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    margin-bottom: 0;
}

.dashboard-bar .chart-section h3 {
    margin-bottom: 0;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 70px;
}

.dashboard-bar .chart-section .horizontal-bars {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    overflow-x: auto;
}

/* ============================================
   Main Layout
   ============================================ */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
}

.main-content {
    display: flex;
    gap: 0;
    flex: 1;
    min-width: 0;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   View Container - Main Content Area
   ============================================ */
.view-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============================================
   Vertical Tabs - Right Side Navigation
   ============================================ */
.view-tabs-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--navy-mid);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.view-tab-v {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--cream-mid);
    transition: var(--transition-normal);
    position: relative;
    min-width: 70px;
}

.view-tab-v::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gold-primary);
    transition: var(--transition-normal);
    border-radius: 0 2px 2px 0;
}

.view-tab-v:hover {
    background: rgba(201, 162, 39, 0.1);
    color: var(--cream-light);
}

.view-tab-v.active {
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-light);
}

.view-tab-v.active::before {
    height: 70%;
}

.view-tab-v .tab-icon {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.view-tab-v .tab-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ============================================
   Map Container - ATLAS Cartographic Frame
   ============================================ */
#map {
    flex: 1;
    min-height: 600px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1;
    overflow: hidden;
    border: 2px solid var(--navy-mid);
    outline: 1px solid var(--gold-primary);
    outline-offset: 2px;
}

/* 지도 스타일 선택기 */
.map-style-control {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--parchment);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--cream-dark);
}

.map-style-control label {
    font-size: 1rem;
    cursor: pointer;
}

.map-style-control select {
    padding: 0.3rem 1.8rem 0.3rem 0.5rem;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%231a2a3a' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.map-style-control select:focus {
    outline: none;
    border-color: var(--gold-primary);
}

/* ============================================
   University Achievement - ATLAS Exploration Progress
   ============================================ */
.university-achievement-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gold-primary);
}

.university-achievement-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(201, 162, 39, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 162, 39, 0.03) 1px, transparent 1px);
    background-size: 15px 15px;
    pointer-events: none;
}

.achievement-ring {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.achievement-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.achievement-ring .ring-bg {
    fill: none;
    stroke: rgba(201, 162, 39, 0.2);
    stroke-width: 8;
}

.achievement-ring .ring-progress {
    fill: none;
    stroke: var(--gold-primary);
    stroke-width: 8;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.5));
}

.achievement-ring .ring-progress.animate {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--cream-light);
}

.achievement-rate {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.achievement-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--cream-light);
    opacity: 0.9;
    margin-top: 2px;
}

.achievement-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.achievement-title {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cream-light);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.achievement-detail {
    font-size: 0.85rem;
    color: var(--cream-mid);
    margin-bottom: 0.6rem;
}

.achievement-detail .visited {
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.achievement-bar {
    height: 8px;
    background: rgba(201, 162, 39, 0.15);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid rgba(201, 162, 39, 0.3);
}

.achievement-bar-fill {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.4);
    position: relative;
}

.achievement-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: var(--radius-full) var(--radius-full) 0 0;
}

/* ============================================
   Stats Panel - ATLAS Data Cards
   ============================================ */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    background: var(--cream-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    opacity: 0;
    transition: var(--transition-normal);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold-primary);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy-mid);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ============================================
   Chart Sections - ATLAS Analytics
   ============================================ */
.chart-section {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-section h3 {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 0.95rem;
    color: var(--navy-mid);
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}

/* ============================================
   Year Chart - ATLAS Style
   ============================================ */
.year-chart {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.year-bar-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.year-bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}

.year-bar-track {
    flex: 1;
    height: 14px;
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.year-bar-fill {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
    min-width: 2px;
}

.year-bar-count {
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--navy-mid);
    min-width: 20px;
    text-align: right;
}

/* ============================================
   Mini Cards - ATLAS Style
   ============================================ */
.horizontal-bars {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.25rem;
    align-items: center;
}

.mini-card {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--cream-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    border-left: 2px solid;
    transition: var(--transition-fast);
    flex-shrink: 0;
    font-size: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.mini-card:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.mini-card.active {
    background: var(--navy-mid);
    border-color: var(--navy-mid);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.mini-card.active .mini-card-count,
.mini-card.active .mini-card-label {
    color: var(--cream-light);
}

.mini-card.active .mini-card-percent {
    color: var(--cream-mid);
}

.mini-card-count {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

.mini-card-label {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.mini-card-percent {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ============================================
   Regional View (시도별 대학 출강 뷰) - ATLAS Territories
   ============================================ */
.regional-panel {
    flex: 1;
    background: var(--parchment);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    flex-direction: column;
    min-height: 600px;
    border: 2px solid var(--navy-mid);
}

.regional-panel.active {
    display: flex;
}

.regional-view-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    color: var(--cream-light);
    border-bottom: 2px solid var(--gold-primary);
}

.regional-view-header h2 {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.03em;
}

.regional-view-desc {
    font-size: 0.9rem;
    color: var(--cream-mid);
    margin: 0;
}

.regional-view-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--parchment);
}

.regional-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

/* Regional Card - ATLAS Territory Card */
.regional-card {
    background: var(--cream-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    overflow: hidden;
    transition: var(--transition-normal);
}

.regional-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--gold-primary);
}

.regional-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-left: 4px solid;
    background: var(--parchment);
    transition: var(--transition-fast);
}

.regional-card-header:hover {
    background: var(--cream-light);
}

.regional-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.region-emoji {
    font-size: 1.3rem;
}

.region-name-large {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-mid);
}

.regional-card-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.visited-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-mid);
}

.total-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rate-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.3rem;
}

.rate-badge.high {
    background: var(--success);
    color: var(--cream-light);
}

.rate-badge.mid {
    background: var(--ocean-mid);
    color: var(--cream-light);
}

.rate-badge.low {
    background: var(--cream-dark);
    color: var(--text-secondary);
}

.expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-left: 0.3rem;
}

.regional-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.regional-card-progress {
    height: 4px;
    background: var(--cream-dark);
}

.regional-card-progress .progress-bar {
    height: 100%;
    transition: width 0.8s ease;
}

.regional-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.regional-card.expanded .regional-card-body {
    max-height: 500px;
    overflow-y: auto;
}

.univ-list {
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    background: var(--cream-light);
}

.univ-item {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.univ-item.visited {
    background: rgba(74, 124, 89, 0.12);
    color: var(--success);
    font-weight: 500;
    border-left: 2px solid var(--success);
}

.univ-item.not-visited {
    background: rgba(26, 42, 58, 0.03);
    color: var(--text-muted);
}

.univ-item:hover {
    transform: translateX(3px);
}

/* ============================================
   View Panels
   ============================================ */
.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
}

#map.view-panel.active {
    display: block;
    flex: 1;
}

/* ============================================
   List Panel (목록 뷰) - ATLAS Records
   ============================================ */
.list-panel {
    flex: 1;
    background: var(--parchment);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    flex-direction: column;
    min-height: 600px;
    border: 2px solid var(--navy-mid);
}

.list-panel.active {
    display: flex;
}

.list-header {
    padding: 1.25rem;
    background: var(--cream-light);
    border-bottom: 1px solid var(--cream-dark);
}

.list-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--navy-light);
    opacity: 0.7;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--parchment);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 0.65rem 2rem 0.65rem 1rem;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--parchment);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a2a3a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: var(--transition-fast);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.filter-reset-btn {
    padding: 0.65rem 1rem;
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--navy-mid);
    color: var(--cream-light);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.filter-reset-btn:hover {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
}

.list-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.list-info span {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--navy-mid);
}

/* ============================================
   Lecture List Items - ATLAS Records
   ============================================ */
.lecture-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--parchment);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    align-content: start;
}

.lecture-list::-webkit-scrollbar {
    width: 6px;
}

.lecture-list::-webkit-scrollbar-track {
    background: var(--cream-mid);
}

.lecture-list::-webkit-scrollbar-thumb {
    background: var(--navy-light);
    border-radius: 3px;
}

.lecture-item {
    padding: 0.6rem 0.75rem;
    background: var(--cream-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    border-left: 3px solid var(--gold-primary);
    transition: var(--transition-normal);
    animation: slideIn 0.2s ease forwards;
    opacity: 0;
    transform: translateY(5px);
    cursor: pointer;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lecture-item:hover {
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.lecture-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.lecture-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lecture-region {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: var(--navy-mid);
    color: var(--cream-light);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.lecture-institution {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy-mid);
    margin-bottom: 0.15rem;
}

.lecture-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lecture-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.lecture-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--cream-light);
    font-weight: 500;
}

.lecture-tag.type-tag {
    background: var(--navy-light);
}

/* 유형별 배경색 - Midnight Blue & Bronze */
.lecture-item.type-teaching {
    background: #e8eef5;
    border-left-color: #415a77;
}

.lecture-item.type-learning {
    background: #e8f0ed;
    border-left-color: #5a7c65;
}

.lecture-item.type-topic {
    background: #f5efe8;
    border-left-color: #cd7f32;
}

.lecture-item.type-research {
    background: #eae8f0;
    border-left-color: #778da9;
}

/* Empty State */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.list-empty p {
    font-size: 1rem;
}

/* ============================================
   Footer - ATLAS Signature
   ============================================ */
.footer {
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    color: var(--cream-mid);
    text-align: center;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    border-top: 2px solid var(--gold-primary);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(201, 162, 39, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 162, 39, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    width: 1.4rem;
    height: 1.4rem;
}

.footer-title {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cream-light);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-subtitle {
    font-size: 0.8rem;
    color: var(--gold-light);
    font-style: italic;
    letter-spacing: 0.05em;
    margin: 0;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--cream-mid);
    margin: 0.25rem 0 0 0;
    align-self: center;
}

/* ============================================
   Leaflet Custom Popup - ATLAS Style
   ============================================ */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--navy-mid);
    background: var(--parchment);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.leaflet-popup-tip {
    background: var(--parchment);
    border: 1px solid var(--navy-mid);
}

.lecture-popup {
    padding: 1.25rem;
}

.lecture-popup .institution {
    font-family: 'Playfair Display', 'Noto Sans KR', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-mid);
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--gold-primary);
}

.lecture-popup .title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

.lecture-popup .info-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.lecture-popup .info-row .icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.lecture-popup .memo {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--cream-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--gold-primary);
}

.lecture-popup .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.lecture-popup .tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: var(--navy-mid);
    color: var(--cream-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(10, 22, 40, 0.2);
    transition: var(--transition-fast);
}

.lecture-popup .tag:hover {
    transform: translateY(-1px);
    background: var(--navy-light);
}

/* ============================================
   Marker Cluster - ATLAS Theme
   ============================================ */
.atlas-cluster-icon {
    background: transparent !important;
}

.atlas-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--cream-light);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(13, 27, 42, 0.4);
    border: 3px solid var(--cream-light);
}

.atlas-cluster-small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    background: var(--navy-light);
}

.atlas-cluster-medium {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
    background: var(--gold-primary);
}

.atlas-cluster-large {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    background: var(--gold-dark);
}

/* ============================================
   Custom Marker - ATLAS Pin
   ============================================ */
.custom-marker {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    border: 3px solid var(--navy-mid);
    border-radius: 50%;
    box-shadow: var(--shadow-lg), 0 0 0 2px var(--gold-light);
    transition: var(--transition-fast);
}

.custom-marker:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-xl), 0 0 0 4px var(--gold-light);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .dashboard-bar-inner {
        gap: 1rem;
        padding: 1rem 1.5rem;
    }

    .dashboard-bar .charts-row {
        gap: 1rem;
    }
}

@media (max-width: 1024px) {
    .dashboard-bar-inner {
        flex-wrap: wrap;
        padding: 1rem 1.25rem;
    }

    .dashboard-bar .charts-row {
        flex: 1 1 100%;
    }

    .dashboard-bar .chart-section {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .dashboard-bar .chart-section h3 {
        min-width: 55px;
        font-size: 0.75rem;
    }

    main {
        padding: 1rem;
    }

    #map {
        outline-offset: 0px;
    }

    .lecture-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .regional-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    main {
        padding: 1rem;
    }

    .main-content {
        flex-direction: column;
    }

    /* 세로 탭을 하단 가로 탭으로 변환 */
    .view-tabs-vertical {
        flex-direction: row;
        order: 2;
        border-radius: var(--radius-md);
        justify-content: center;
        margin-top: 1rem;
    }

    .view-tab-v {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        min-width: auto;
    }

    .view-tab-v::before {
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 0;
        height: 3px;
    }

    .view-tab-v.active::before {
        width: 70%;
        height: 3px;
    }

    .view-tab-v .tab-icon {
        margin-bottom: 0;
    }

    .view-container {
        order: 1;
    }

    #map {
        min-height: 450px;
        outline-offset: 0px;
    }

    .list-panel {
        min-height: 500px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem 1.5rem;
    }

    .header h1 {
        font-size: 1.4rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-subtitle {
        font-size: 0.7rem;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }

    .dashboard-bar-inner {
        padding: 1rem;
        gap: 1rem;
    }

    .dashboard-bar .chart-section {
        flex: 1 1 100%;
        flex-direction: row;
    }

    .dashboard-bar .charts-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dashboard-bar .stat-number {
        font-size: 1.5rem;
    }

    .dashboard-bar .stat-label {
        font-size: 0.75rem;
    }

    #map {
        min-height: 380px;
        outline: none;
    }

    .chart-section h3 {
        font-size: 0.9rem;
    }

    .lecture-list {
        grid-template-columns: 1fr;
    }

    .regional-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .leaflet-popup-content {
        min-width: 220px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .header-content {
        padding: 1rem 0.75rem;
    }

    .header h1 {
        font-size: 1.2rem;
        gap: 0.5rem;
    }

    .header-logo {
        width: 1.5rem;
        height: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.6rem;
        letter-spacing: 0.05em;
    }

    .footer-logo {
        width: 1.2rem;
        height: 1.2rem;
    }

    .footer-title {
        font-size: 0.95rem;
    }

    .footer-subtitle {
        font-size: 0.7rem;
    }

    .footer-copyright {
        font-size: 0.65rem;
    }

    .dashboard-bar .university-achievement-section {
        padding: 1rem;
    }

    .dashboard-bar .stat-item {
        min-width: 65px;
        padding: 0.5rem;
    }

    .view-tab-v .tab-label {
        display: none;
    }

    .regional-grid {
        grid-template-columns: 1fr;
    }

    .view-tab-v .tab-icon {
        font-size: 1.2rem;
    }

    #map {
        min-height: 320px;
        border-radius: var(--radius-md);
        outline: none;
    }

    .leaflet-popup-content {
        min-width: 200px;
    }

    .dashboard-bar-inner {
        padding: 0.75rem;
    }

    .stats-panel {
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.75rem 0.25rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--navy-mid);
    color: var(--cream-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: 1rem;
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(205, 127, 50, 0.2);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .achievement-bar-fill {
        transition: none;
    }

    .year-bar-fill {
        transition: none;
    }
}

/* ============================================
   Animation Utilities
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading State */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Page Load */
body {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
