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

:root {
    /* VS Code Dark accent colors */
    --primary: #007acc;
    --primary-dark: #005a9e;
    --success: #4ec9b0;
    --warning: #d7ba7d;
    --danger: #f48771;
    --info: #3794ff;

    /* VS Code Dark Mode Colors */
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --text-primary: #d4d4d4;
    --text-secondary: #9d9d9d;
    --text-muted: #6a6a6a;
    --border-color: #3e3e42;
    --card-bg: #252526;
    --card-hover: #2d2d30;

    /* Additional gray variables (used in HTML) */
    --gray-50: #2d2d30;
    --gray-600: #9d9d9d;
    --gray-700: #6a6a6a;
    --gray-900: #1e1e1e;

    /* Warning background */
    --warning-light: rgba(215, 186, 125, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2d2d30 0%, #1e1e1e 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0,0,0,0.5);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
    padding: 2rem 0.5rem;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    font-size: 1rem;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: rgba(255,255,255,0.5);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.2);
    border-left-color: white;
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 1.25rem;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: 250px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 70px;
    width: calc(100% - 70px);
}

.main-content {
    display: none;
}

.main-content.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2d2d30 0%, #1e1e1e 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* Sections */
section {
    padding: 3rem 0;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Situation Summary */
.situation-summary {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgba(6, 182, 212, 0.15);
    border-left: 4px solid var(--info);
    color: var(--text-primary);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid var(--warning);
    color: var(--text-primary);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid var(--danger);
    color: var(--text-primary);
}

.alert h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.alert ul {
    list-style: none;
    padding-left: 0;
}

.alert li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.alert li:last-child {
    border-bottom: none;
}

/* Dashboard */
.dashboard {
    background: var(--bg-secondary);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.card-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.card-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.card-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.card h3 {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.big-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.card p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Evaluation Criteria */
.evaluation-criteria {
    background: var(--bg-secondary);
}

.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.criteria-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.criteria-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.5);
    background: var(--card-hover);
}

.criteria-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.criteria-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.criteria-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.criteria-weight {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.criteria-reason {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-style: italic;
}

.criteria-detail {
    list-style: none;
    padding-left: 0;
    font-size: 0.9rem;
}

.criteria-detail li {
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    position: relative;
    color: var(--text-secondary);
}

.criteria-detail li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Top Cities */
.top-cities {
    background: var(--bg-primary);
}

.city-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.city-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.7);
    background: var(--card-hover);
}

.city-card.recommended {
    border: 3px solid var(--primary);
}

.city-card.recommended::before {
    content: "🎖️ 최고 추천";
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.rank {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.city-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.stars {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.score {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
}

.highlights {
    list-style: none;
    margin: 1.5rem 0;
}

.highlights li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.highlights li:last-child {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-link {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-link:hover {
    background: var(--primary);
    color: white;
}

/* City Comparison */
.city-comparison {
    background: var(--bg-secondary);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.filter-group input[type="range"] {
    width: 100%;
}

.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#budgetValue {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* Table */
.table-container {
    overflow-x: auto;
}

.city-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.city-table thead {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.city-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.city-table th:hover {
    background: var(--bg-primary);
}

.city-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.city-table tbody tr:hover {
    background: var(--card-hover);
}

.city-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-high {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #34d399;
}

.badge-medium {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.badge-low {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #f87171;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    border: 1px solid #6366f1;
}

.badge-gray {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid #9ca3af;
}

/* Calculator */
.calculator {
    background: var(--bg-primary);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calculator-inputs,
.calculator-results {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

.calculator-inputs h3,
.calculator-results h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.unit {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.result-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.result-summary {
    margin-bottom: 2rem;
}

.result-summary h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.result-status {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
}

.result-status.success {
    background: var(--success);
    color: white;
}

.result-status.warning {
    background: var(--warning);
    color: white;
}

.result-status.danger {
    background: var(--danger);
    color: white;
}

.breakdown {
    margin-top: 1.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Guide */
.guide {
    background: var(--bg-secondary);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.guide-card {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    border: 1px solid var(--border-color);
}

.guide-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guide-card ul {
    list-style: none;
    padding-left: 0;
}

.guide-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.guide-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.guide-card li strong {
    color: var(--danger);
}

/* Warnings */
.warnings {
    background: var(--bg-primary);
}

.warning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.warning-item {
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    border: 1px solid var(--border-color);
}

.warning-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--text-primary);
}

.warning-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--text-primary);
}

.warning-info {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--info);
    color: var(--text-primary);
}

.warning-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .nav {
        flex-wrap: wrap;
    }

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

    .city-cards,
    .criteria-grid,
    .guide-grid,
    .warning-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-card,
.card,
.guide-card,
.warning-item {
    animation: fadeIn 0.5s ease-out;
}

/* Comparison Panel */
.comparison-panel {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 2px solid var(--primary);
}

.comparison-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

/* Sub Tabs */
.sub-tabs-nav {
    display: flex;
    flex-wrap: wrap;  /* 멀티라인 레이아웃: 대학이 늘어나면 자동으로 줄 추가 */
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sub-tab-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sub-tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.sub-tab-btn.active {
    background: white;
    color: var(--primary);
    border-color: white;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Map Links Grid */
.map-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.map-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.map-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    background: var(--card-hover);
}

.map-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.map-info {
    flex: 1;
}

.map-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.map-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.map-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Map Type Tabs */
.map-type-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.map-type-btn {
    padding: 1rem 2rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-type-btn:hover {
    background: var(--card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.map-type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.map-type-content {
    display: none;
}

.map-type-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Map Container */
.map-container-wrapper {
    margin-top: 2rem;
}

.map-info-panel {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.map-info-panel h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.map-info-panel p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.map-info-panel ul {
    list-style: none;
    padding: 0;
}

.map-info-panel ul li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.map-info-panel ul li:last-child {
    border-bottom: none;
}

/* MapLibre & Leaflet Dark Mode Adjustments */
.maplibregl-ctrl-attrib,
.leaflet-control-attribution {
    background: rgba(15, 23, 42, 0.9) !important;
    color: var(--text-secondary) !important;
}

.maplibregl-popup-content,
.leaflet-popup-content-wrapper {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
    background: var(--card-bg) !important;
}

.maplibregl-popup-close-button,
.leaflet-popup-close-button {
    color: var(--text-primary) !important;
    font-size: 1.5rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .map-type-tabs {
        flex-direction: column;
    }

    .map-type-btn {
        width: 100%;
        justify-content: center;
    }

    #maplibre-container,
    #leaflet-container {
        height: 60vh !important;
    }
}

/* ============================================
   Location Info Modal Styles
   ============================================ */

.location-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

.location-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
    z-index: 10001;
}

.modal-close {
    position: sticky;
    top: 1rem;
    float: right;
    margin: 1rem 1rem 0 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-header {
    padding: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.location-section {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.location-section:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.location-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.location-info {
    flex: 1;
}

.location-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.location-name-ja {
    margin: 0.5rem 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.location-name-ko {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.location-name-en {
    margin: 0.25rem 0 1rem 0;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.location-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wiki-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wiki-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.namu-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.namu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.university-section {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.maps-section {
    padding: 0;
    background: transparent;
    border: none;
}

.maps-section:hover {
    box-shadow: none;
}

.maps-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.maps-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.maps-icon {
    font-size: 1.5rem;
}

.maps-text {
    flex: 1;
}

.maps-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.maps-link:hover .maps-arrow {
    transform: translateX(5px);
}

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

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

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .location-section {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .location-icon {
        font-size: 2rem;
    }

    .location-name-ja {
        font-size: 1.3rem;
    }

    .location-name-ko {
        font-size: 1rem;
    }

    .location-links {
        flex-direction: column;
    }

    .link-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================ */
/* Detail Toggle & Content Styles */
/* ============================================ */

.detail-toggle-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.detail-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.detail-toggle-btn:active {
    transform: translateY(0);
}

.detail-toggle-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.detail-content {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    animation: slideDown 0.3s ease-in-out;
}

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

.detail-item {
    margin-bottom: 1.5rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.detail-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-line;
}

/* Dark mode adjustments for detail content */
body.dark-mode .detail-content {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .detail-item h4 {
    color: #a78bfa;
}

body.dark-mode .detail-item p {
    color: var(--text-secondary);
}

/* ============================================
   즐겨찾기 기능 스타일
   ============================================ */

/* 즐겨찾기 카운트 배지 */
.favorite-count {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* 즐겨찾기 토글 버튼 (서브탭 버튼 내부) */
.favorite-toggle-btn {
    display: inline-block;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    user-select: none;
}

.favorite-toggle-btn:hover {
    transform: scale(1.2);
}

.favorite-toggle-btn:active {
    transform: scale(0.9);
}

/* 즐겨찾기 페이지 스타일 */
#favorites-content-wrapper {
    min-height: 400px;
}

#no-favorites-message {
    text-align: center;
    padding: 3rem 0;
}

#no-favorites-message .alert {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

#no-favorites-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#no-favorites-message p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 즐겨찾기 서브탭 버튼 스타일 강화 */
#favorites-subtabs .sub-tab-btn {
    position: relative;
    overflow: visible;
}

/* 로딩 스피너 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 4px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ef4444;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

/* 다크모드 지원 */
body.dark-mode .favorite-count {
    background: #dc2626;
}

body.dark-mode #no-favorites-message h3 {
    color: var(--text-primary);
}

body.dark-mode #no-favorites-message p {
    color: var(--text-secondary);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .favorite-toggle-btn {
        font-size: 0.9rem;
        margin-left: 0.3rem;
    }
    
    .favorite-count {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
    }
    
    #no-favorites-message {
        padding: 2rem 1rem;
    }
}
