html {
    scroll-behavior: smooth;
}

:root {
    --bg-main: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary-accent: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #1e293b;
    --text-dim: #64748b;
    --glass-border: rgba(99, 102, 241, 0.1);
    --safe-area: 1.25rem;

    /* Pastel City Palette */
    --pastel-blue: #bae6fd;
    --pastel-pink: #fbcfe8;
    --pastel-purple: #ddd6fe;
    --pastel-teal: #ccfbf1;
    --pastel-orange: #ffedd5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background: url('bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Overlay for better readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    z-index: -1;
}

/* Urban Background Effect */
.background-radial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 207, 232, 0.1) 0px, transparent 50%);
    z-index: -1;
}

.stars-container {
    display: none;
    /* Hide stars for urban look */
}

/* Layout */
.container {
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5rem;
    z-index: 1;
}

.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    gap: 4rem;
    padding: 0 2rem;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

/* CSS Weather Sphere */
.weather-sphere {
    width: clamp(250px, 35vw, 400px);
    height: clamp(250px, 35vw, 400px);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(99, 102, 241, 0.1));
    border-radius: 50%;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        inset 0 0 50px rgba(255, 255, 255, 0.2),
        0 20px 50px rgba(99, 102, 241, 0.15);
    animation: floatSphere 6s ease-in-out infinite;
}

.glow-inner {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulseGlow 4s ease-in-out infinite;
}

.orbit {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    animation: rotateOrbit 15s linear infinite;
}

@keyframes floatSphere {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes rotateOrbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-text-area {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 0.95;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.accent-text {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.2));
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.5;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 3.5rem;
    border-left: 6px solid var(--primary-accent);
    padding-left: 1.8rem;
}

.scroll-cta {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-accent);
    letter-spacing: 0.02em;
}

.cta-arrow {
    width: 60px;
    height: 60px;
    background: var(--primary-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-arrow span {
    width: 14px;
    height: 14px;
    border-bottom: 4px solid white;
    border-right: 4px solid white;
    transform: rotate(45deg);
    margin-top: -5px;
    animation: ctaMove 1.5s infinite;
}

@keyframes ctaMove {
    0% {
        transform: rotate(45deg) translate(-12px, -12px);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: rotate(45deg) translate(10px, 10px);
        opacity: 0;
    }
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin: 1rem auto 0;
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    width: fit-content;
    max-width: 95%;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--primary-accent);
    background: rgba(99, 102, 241, 0.05);
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Generator Card */
.generator-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: clamp(1.5rem, 5vw, 3rem);
    padding: clamp(1.5rem, 5vw, 3.5rem);
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.1),
        0 18px 36px -18px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

/* Selection Area */
.selection-area {
    width: 100%;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.styled-select {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    min-width: 200px;
    outline: none;
    transition: all 0.3s ease;
}

.styled-select:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    flex: 2;
}

.outfit-card {
    flex: 1;
    min-width: 280px;
    background: white;
    padding: 1.5rem;
    border-radius: 2rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.outfit-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.outfit-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.outfit-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 1.5rem;
    background: #f8fafc;
}

.outfit-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-accent);
}

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

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

.stat-item {
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Tabs Area */
.info-card {
    background: white;
    padding: 2.5rem;
    border-radius: 2rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.info-content {
    color: var(--text-dim);
    line-height: 1.8;
}

.info-content p {
    margin-bottom: 1rem;
}

.info-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-content li {
    margin-bottom: 0.5rem;
}

.info-content strong {
    color: var(--text-main);
}

/* Contact Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

.tabs-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.3rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.8rem;
    width: fit-content;
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
}

/* Display Area */
.display-area {
    width: 100%;
}

.hidden {
    display: none !important;
}

.status-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-tile {
    background: white;
    padding: 1rem;
    border-radius: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: transform 0.3s ease;
}

.status-tile.is-today {
    border: 2px solid var(--primary-accent);
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.today-badge {
    position: absolute;
    top: -10px;
    background: var(--primary-accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.tile-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
    text-align: center;
    padding-bottom: 0.4rem;
}

.tile-comparison {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 0.5rem;
}

.compare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.compare-label {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.compare-icon {
    font-size: 1.4rem;
}

/* Scrollbar styling for grid */
.status-grid-view::-webkit-scrollbar {
    width: 6px;
}

.status-grid-view::-webkit-scrollbar-track {
    background: transparent;
}

.status-grid-view::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Chart */
.chart-container {
    width: 100%;
    height: 350px;
    background: rgba(255, 255, 255, 0.3);
    padding: 1.5rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Button override */
.primary-btn {
    white-space: nowrap;
}

.numbers-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
}

.lotto-ball {
    width: 75px;
    height: 75px;
    border-radius: 1.5rem;
    /* Smoother urban edges */
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lotto-ball.empty {
    background: #f1f5f9;
    color: #cbd5e1;
}

.lotto-ball.active {
    transform: translateY(-8px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Pastel City Color Logic */
.ball-range-1 {
    background: var(--pastel-blue);
    border-color: #7dd3fc;
}

.ball-range-2 {
    background: var(--pastel-purple);
    border-color: #c4b5fd;
}

.ball-range-3 {
    background: var(--pastel-pink);
    border-color: #f9a8d4;
}

.ball-range-4 {
    background: var(--pastel-teal);
    border-color: #99f6e4;
}

.ball-range-5 {
    background: var(--pastel-orange);
    border-color: #fdba74;
}

/* Button */
.primary-btn {
    position: relative;
    padding: 1rem 3rem;
    background: var(--text-main);
    border: none;
    border-radius: 1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.primary-btn:hover {
    background: var(--primary-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

/* History */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.history-item {
    background: white;
    border: 1px solid #f1f5f9;
    padding: 1.2rem 2rem;
    border-radius: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.history-ball {
    width: 32px;
    height: 32px;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-dim);
    padding: 0.4rem 1rem;
    border-radius: 0.7rem;
    font-weight: 500;
}

.copy-btn:hover {
    background: var(--primary-accent);
    color: white;
    border-color: var(--primary-accent);
}

/* Floating Scroll Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
}

.scroll-top-btn:hover {
    background: var(--primary-accent);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
}

.scroll-top-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Footer */
.footer {
    padding: 3rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 var(--safe-area);
        gap: 2rem;
    }

    .nav-menu {
        padding: 0.6rem 1.2rem;
        gap: 0.8rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
        gap: 2rem;
    }

    .hero-text-area {
        text-align: center;
        align-items: center;
    }

    .hero-subtitle {
        border-left: none;
        padding-left: 0;
        border-top: 3px solid var(--primary-accent);
        padding-top: 1rem;
    }

    .weather-sphere {
        width: 220px;
        height: 220px;
    }

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

    .outfit-card {
        min-width: 100%;
        padding: 1.2rem;
    }

    .outfit-img {
        width: 120px;
        height: 120px;
    }

    .chart-container {
        height: 280px;
        padding: 1rem;
    }

    .info-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .status-tile {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .selection-area {
        flex-direction: column;
        width: 100%;
    }

    .styled-select {
        width: 100%;
    }

    .primary-btn {
        width: 100%;
    }
}