:root {
    --primary-purple: #8B5CF6;
    --primary-cyan: #06B6D4;
    --neon-pink: #FF10F0;
    --neon-blue: #10D7FF;
    --neon-green: #39FF14;

    --dark-bg: #0A0A0F;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.05);

    --text-primary: #FFFFFF;
    --text-secondary: #B8B8D0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 16, 240, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(16, 215, 255, 0.15) 0%, transparent 50%);
    animation: bgFloat 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bgFloat {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(45deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 0;
}

.back-button {
    position: absolute;
    top: 2rem;
    left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-pink);
    box-shadow: 0 4px 15px rgba(255, 16, 240, 0.3);
    transform: translateY(-2px);
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--neon-pink), var(--neon-blue), var(--neon-green));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neonText 3s ease-in-out infinite;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 16, 240, 0.5);
}

@keyframes neonText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 섹션 스타일 */
.congestion-section,
.AroundStationSeoul-section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(45deg, var(--neon-blue), var(--primary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(255, 16, 240, 0.2); }
}


/* 그리드 스타일 */
.congestion-grid,
.AroundStationSeoul-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.area-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.area-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.6s;
}

.area-card:hover::before {
    left: 100%;
}

.area-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--neon-pink);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(255, 16, 240, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.area-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue), var(--neon-green));
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
}

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

.area-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.congestion-level {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.level-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-여유 {
    background: linear-gradient(135deg, var(--neon-green), #00FF88);
    color: #000;
    animation: neonGlow 2s ease-in-out infinite;
}

.level-보통 {
    background: linear-gradient(135deg, #FFA500, #FF6B35);
    color: white;
}

.level-약간붐빔 {
    background: linear-gradient(135deg, #FF6B6B, var(--neon-pink));
    color: white;
    animation: urgentPulse 1s ease-in-out infinite;
}

.level-붐빔 {
    background: linear-gradient(135deg, #FF0080, #FF4040);
    color: white;
    animation: lastDayPulse 1.5s ease-in-out infinite;
}

@keyframes neonGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(57, 255, 20, 0.5); }
    50% { box-shadow: 0 0 20px rgba(57, 255, 20, 0.8), 0 0 30px rgba(57, 255, 20, 0.4); }
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes lastDayPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 0, 128, 0.6);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 25px rgba(255, 0, 128, 0.9), 0 0 35px rgba(255, 64, 64, 0.5);
    }
}

.level-indicator {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.level-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
    position: relative;
}

.level-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.bar-여유 {
    background: linear-gradient(135deg, var(--neon-green), #00FF88);
    width: 25%;
}

.bar-보통 {
    background: linear-gradient(135deg, #FFA500, #FF6B35);
    width: 50%;
}

.bar-약간붐빔 {
    background: linear-gradient(135deg, #FF6B6B, var(--neon-pink));
    width: 75%;
}

.bar-붐빔 {
    background: linear-gradient(135deg, #FF0080, #FF4040);
    width: 100%;
}

.update-info {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}


.error-badge {
    background: linear-gradient(135deg, #FF6B6B, #FF4040);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.4;
}


/* 로딩 및 에러 상태 */
.loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 60px 0;
    color: #FF6B6B;
    font-size: 1.1rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 24px;
    margin: 2rem 0;
}

/* Floating particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-pink);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .congestion-grid,
    .AroundStationSeoul-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .area-card {
        padding: 24px;
    }

    .back-button {
        top: 1rem;
        left: 0.5rem;
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .area-name {
        font-size: 1.3rem;
    }

    .level-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
        min-width: 70px;
    }

    .congestion-level {
        gap: 10px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .congestion-grid,
    .AroundStationSeoul-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .area-card {
        padding: 20px;
    }

    .area-name {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .level-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-width: 60px;
    }

    .data-time,
    .agency-name {
        font-size: 0.7rem;
    }

    .status-message {
        font-size: 0.75rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-blue));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-blue), var(--neon-green));
}

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

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #FFFFFF;
        --text-secondary: #CCCCCC;
        --card-bg: rgba(255, 255, 255, 0.1);
        --glass-bg: rgba(255, 255, 255, 0.2);
    }
    
    .area-card {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .level-badge {
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}
