/* ===================================
   Yeobaek - White Canvas & Watercolor
   =================================== */

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

:root {
    /* Color Palette */
    --bg-paper: #F9F8F6;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --input-border: #D4D0C8;
    
    /* Personal Aura - 생년월일 기반 고유 색상 시스템 */
    /* Dynamic values set by JavaScript */
    --orb-hue-1: 0;      /* Base Hue (Identity) - 0~360 */
    --orb-hue-2: 45;     /* Secondary Hue - 0~360 */
    --orb-light: 60;     /* Lightness (Energy) - 45~65 */
    
    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-primary);
    background-color: #F5F4F1; /* Darker warm grey for contrast */
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===================================
   Aurora Glow Background - Intro Only (Enhanced)
   =================================== */

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    
    /* Enhanced Aurora Gradient - 더 풍부한 색상과 큰 영역 */
    background: 
        radial-gradient(ellipse 80vw 80vh at 10% 20%, rgba(30, 60, 150, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 70vw 90vh at 90% 30%, rgba(140, 60, 190, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse 85vw 75vh at 30% 80%, rgba(200, 40, 140, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 75vw 85vh at 80% 90%, rgba(255, 180, 80, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 90vw 80vh at 50% 40%, rgba(60, 180, 220, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 70vw 70vh at 70% 60%, rgba(100, 80, 250, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse 80vw 90vh at 40% 50%, rgba(255, 220, 120, 0.3) 0%, transparent 60%);
    
    animation: auroraFlow 25s ease-in-out infinite;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Intro State - Aurora Visible */
body:not(.is-result-shown)::before {
    opacity: 1;
}

/* Result State - Aurora Hidden */
body.is-result-shown::before {
    opacity: 0;
}

/* Enhanced Aurora Animation - 넘실거리는 빛의 파동 */
@keyframes auroraFlow {
    0% {
        transform: translate(0%, 0%) rotate(0deg) scale(1);
        background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, 50% 50%, 70% 30%, 30% 70%;
        filter: hue-rotate(0deg) blur(120px);
    }
    20% {
        transform: translate(8%, -5%) rotate(3deg) scale(1.05);
        background-position: 25% 35%, 75% 25%, 35% 85%, 80% 95%, 60% 45%, 65% 40%, 40% 65%;
        filter: hue-rotate(45deg) blur(140px);
    }
    40% {
        transform: translate(-5%, 10%) rotate(-2deg) scale(1.08);
        background-position: 50% 60%, 50% 50%, 60% 75%, 70% 70%, 45% 65%, 55% 55%, 50% 55%;
        filter: hue-rotate(90deg) blur(160px);
    }
    60% {
        transform: translate(10%, 8%) rotate(4deg) scale(1.06);
        background-position: 65% 70%, 40% 65%, 70% 50%, 90% 60%, 35% 70%, 45% 65%, 60% 45%;
        filter: hue-rotate(60deg) blur(150px);
    }
    80% {
        transform: translate(-8%, -6%) rotate(-3deg) scale(1.04);
        background-position: 35% 40%, 75% 70%, 45% 60%, 85% 75%, 55% 50%, 60% 50%, 35% 60%;
        filter: hue-rotate(30deg) blur(130px);
    }
    100% {
        transform: translate(0%, 0%) rotate(0deg) scale(1);
        background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, 50% 50%, 70% 30%, 30% 70%;
        filter: hue-rotate(0deg) blur(120px);
    }
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 32px;
}

/* ===================================
   Sequential Fade-in Animation
   =================================== */

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


/* ===================================
   Logo - Minimal & Precious
   =================================== */

.logo {
    padding: 50px 0 20px;
    text-align: center;
    opacity: 0;
    animation: fadeUpFull 1s ease-out 0.2s forwards;
}

.logo h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.1rem;
    text-transform: none;
    color: var(--text-primary);
    margin: 0;
}

.intro-text {
    margin-top: 8px;
    font-family: 'Pretendard', var(--font-primary);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.02rem;
    color: #888888;
    opacity: 0;
    text-align: center;
    animation: fadeUpFull 1s ease-out 0.5s forwards;
}

/* ===================================
   Aura Name Display
   =================================== */

.aura-name {
    text-align: center;
    padding: 0;
    font-family: 'Pretendard', var(--font-primary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.05rem;
    text-transform: none;
    color: #1a1a1a;
    opacity: 0;
    margin: 5px 0 10px;
    min-height: 24px;
    line-height: 1.2;
    z-index: 100;
    position: relative;
    transform: translateY(10px);
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.aura-name.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Main Content
   =================================== */

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0px;
    gap: 15px;
}

/* ===================================
   Input Section - Underline Style
   =================================== */

.input-section {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.label {
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.05rem;
    color: #888888;
    text-align: center;
    opacity: 0;
    animation: fadeUpFull 1s ease-out 0.8s forwards;
}

/* Date Input Group - Korean Style (Year/Month/Day) */
.date-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    opacity: 0;
    animation: fadeUpFull 1s ease-out 1.1s forwards;
}

.date-part {
    padding: 16px 8px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--input-border);
    text-align: center;
    outline: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.date-part.year {
    width: 80px;
}

.date-part.month,
.date-part.day {
    width: 50px;
}

.date-part:focus {
    border-bottom-color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.1);
}

.date-part::placeholder {
    color: #888888;
    opacity: 0.5;
}

.divider {
    font-size: 16px;
    font-weight: 200;
    color: #888888;
    user-select: none;
}

/* ===================================
   Gradient Orb - Visual Core
   =================================== */

.orb-container {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-orb {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    
    /* Personal Aura - 생년월일 기반 복합 그라데이션 */
    /* 두 개의 Hue와 동적인 Lightness를 조합하여 수천 가지 색상 조합 생성 */
    background-image: 
        radial-gradient(
            circle at 30% 30%, 
            hsl(var(--orb-hue-1), 90%, var(--orb-light)),
            hsl(var(--orb-hue-2), 100%, calc(var(--orb-light) - 15%))
        );
    
    /* 몽환적인 느낌을 위한 블러 (mix-blend-mode 제거로 흰 배경에서 선명하게 보임) */
    filter: blur(20px);
    mix-blend-mode: normal;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 2s cubic-bezier(0.4, 0, 0.2, 1),
                background 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: liquidMorphing 10s ease-in-out infinite;
}

.gradient-orb.active {
    opacity: 0.85; /* Personal Aura가 더 선명하게 보이도록 */
    transform: scale(1);
}

.orb-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-glow.active {
    opacity: 0.6;
}

/* Liquid Morphing Animation - Organic Blob Movement */
@keyframes liquidMorphing {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(15px, -18px) rotate(20deg);
    }
    40% {
        border-radius: 50% 50% 20% 80% / 25% 70% 50% 75%;
        transform: translate(-20px, 12px) rotate(-15deg);
    }
    60% {
        border-radius: 80% 20% 50% 50% / 70% 40% 60% 30%;
        transform: translate(18px, 20px) rotate(25deg);
    }
    80% {
        border-radius: 40% 70% 60% 30% / 60% 50% 40% 50%;
        transform: translate(-15px, -10px) rotate(-20deg);
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
}

/* ===================================
   Personal Aura System
   생년월일에 따라 수천 가지 고유 색상 조합 생성
   더 이상 단순 나이별 색상 구분 없음
   =================================== */

/* ===================================
   Result Section
   =================================== */

.result-section {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.percentage {
    font-size: 56px;
    font-weight: 200;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1;
}

.message {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.03rem;
    color: #4a4a4a;
    margin-bottom: 16px;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

.message.refresh-blink {
    animation: messageBlink 0.3s ease;
}

@keyframes messageBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Refresh Button */
.refresh-btn {
    background: none;
    border: none;
    font-family: 'Pretendard', var(--font-primary);
    font-size: 11px;
    font-weight: 300;
    color: #888888;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 12px;
    margin-bottom: 16px;
    transition: opacity 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.refresh-btn:hover {
    opacity: 1;
}

.refresh-btn:active {
    opacity: 0.6;
}

.days-info {
    font-size: 12px;
    font-weight: 300;
    color: #4a4a4a;
    letter-spacing: 0.05rem;
}

/* ===================================
   Footer
   =================================== */

.footer {
    padding: 20px 0 60px;
    text-align: center;
}

.footer p {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.1rem;
    color: #888888;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 375px) {
    .container {
        padding: 0 24px;
    }
    
    .logo h1 {
        font-size: 20px;
        letter-spacing: 0.08rem;
    }
    
    .orb-container {
        width: 200px;
        height: 200px;
    }
    
    .gradient-orb {
        width: 160px;
        height: 160px;
        filter: blur(25px); /* Personal Aura intensity on mobile */
        /* Personal Aura gradient inherited from main styles */
    }
    
    .percentage {
        font-size: 48px;
        font-weight: 200;
    }
}

@media (min-width: 481px) {
    .container {
        padding: 0 48px;
    }
}

/* ===================================
   Accessibility & Touch
   =================================== */

@media (hover: hover) {
    .date-part:hover {
        border-bottom-color: var(--text-primary);
    }
}

/* Prevent text selection on touch */
.logo h1,
.label,
.percentage,
.message,
.days-info,
.footer p {
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ===================================
   Share Static Button
   =================================== */

.share-static-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 40px auto 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}

.share-static-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.share-static-btn:active {
    transform: translateY(0);
}

.share-static-btn svg {
    width: 20px;
    height: 20px;
}

/* ===================================
   Sound Control Button
   =================================== */

.sound-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    color: #888888;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sound-btn:hover {
    color: #1a1a1a;
}

.sound-btn:active {
    opacity: 0.6;
    transform: scale(0.95);
}

.sound-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile touch area optimization */
@media (max-width: 768px) {
    .sound-btn {
        width: 48px;
        height: 48px;
        padding: 12px;
    }
}
