/* ===== CSS Variables ===== */
:root {
    --primary-blue: #1e3a8a;
    --primary-blue-light: #3b82f6;
    --accent-blue: #60a5fa;
    --accent-cyan: #22d3ee;
    --bg-dark: #0a0f1a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-start: #1e3a8a;
    --gradient-end: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.3);
}

/* ===== Light Mode ===== */
body.light-mode {
    --primary-blue: #2563eb;
    --primary-blue-light: #3b82f6;
    --accent-blue: #1d4ed8;
    --accent-cyan: #0891b2;
    --bg-dark: #f0f9ff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(30, 58, 138, 0.15);
    --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.2);
}

body.light-mode .gradient-orb {
    opacity: 0.3;
}

body.light-mode .background-overlay {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.08) 0%, transparent 60%);
}

body.light-mode .title {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-blue) 50%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .countdown-value {
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .countdown-item {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-mode .progress-section {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

body.light-mode .theme-toggle .sun-icon {
    display: block;
}

body.light-mode .theme-toggle .moon-icon {
    display: none;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Background Effects ===== */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background-image: url('background.png');
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    opacity: 0.15;
    mix-blend-mode: luminosity;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--gradient-end) 100%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--primary-blue-light) 100%);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--accent-blue) 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    animation-duration: 30s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }

    75% {
        transform: translate(-50px, -30px) scale(1.05);
    }
}

/* ===== Container ===== */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2.5rem;
}

/* ===== Header ===== */
.header {
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.term-info {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-weight: 400;
}

/* ===== Countdown ===== */
.countdown-container {
    width: 100%;
    max-width: 1200px;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.countdown-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.countdown-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.countdown-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem 1.5rem;
    min-width: 100px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 0.3rem;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.countdown-item:hover::before {
    opacity: 1;
}

.countdown-value-wrapper {
    position: relative;
}

.countdown-value {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    display: inline;
}

.countdown-separator {
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--text-muted);
    font-weight: 300;
    align-self: center;
    opacity: 0.5;
}

.seconds-item .countdown-value {
    animation: tickPulse 1s ease-in-out infinite;
}

@keyframes tickPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ===== Progress Section ===== */
.progress-section {
    width: 100%;
    max-width: 600px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-percent {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-blue-light) 0%, var(--accent-cyan) 100%);
    border-radius: 50px;
    transition: width 1s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: fadeInUp 1s ease-out 0.9s backwards;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        gap: 2rem;
    }

    .countdown-grid {
        gap: 0.75rem;
    }

    .countdown-item {
        min-width: 80px;
        padding: 1rem 1rem;
        border-radius: 16px;
        gap: 0.2rem;
    }

    .countdown-separator {
        display: none;
    }

    .progress-section {
        padding: 1.25rem 1.5rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .countdown-grid {
        gap: 1rem;
    }

    .countdown-row {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .countdown-separator {
        display: none;
    }

    .countdown-item {
        min-width: unset;
        padding: 0.75rem 0.75rem;
        gap: 0.15rem;
    }

    .countdown-value {
        font-size: 1.8rem;
    }

    .countdown-label {
        font-size: 1.8rem;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.25rem;
    }

    .progress-dates {
        font-size: 0.7rem;
    }
}

/* ===== Dark Mode Enhancement ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #050810;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}