/* ========================================
   CSS Variables & Design Tokens
   ======================================== */
:root {
    /* Colors */
    --color-primary: #6366f1;
    --color-primary-light: #818cf8;
    --color-primary-dark: #4f46e5;
    --color-secondary: #f59e0b;
    --color-accent: #10b981;

    /* Background */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e1b4b;

    /* Card colors */
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-hover: rgba(255, 255, 255, 0.12);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   Background Effects
   ======================================== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    bottom: 20%;
    left: -100px;
    animation-delay: -7s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    bottom: -50px;
    right: 20%;
    animation-delay: -14s;
}

@keyframes float {

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

    25% {
        transform: translateY(-30px) rotate(5deg);
    }

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

    75% {
        transform: translateY(30px) rotate(-5deg);
    }
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* ========================================
   Header
   ======================================== */
.header {
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-glow);
    animation: pulse 3s infinite ease-in-out;
}

.rice-cooker-icon {
    width: 70px;
    height: 70px;
}

.indicator-light {
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: var(--shadow-glow);
    }

    50% {
        box-shadow: 0 0 60px rgba(99, 102, 241, 0.5);
    }
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.card-icon {
    font-size: 1.25rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   Current Time Display
   ======================================== */
.current-time-card {
    text-align: center;
}

.current-time-display {
    font-size: 3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #f8fafc 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: var(--spacing-md) 0;
    letter-spacing: 0.05em;
}

.current-date {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   Time Picker
   ======================================== */
.time-picker-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.time-picker-wrapper {
    flex: 1;
    max-width: 160px;
}

.picker-label {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.time-separator {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 2.5rem;
    align-self: flex-start;
}

.slider-container {
    position: relative;
    padding: var(--spacing-md) 0;
}

.slider-value {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
}

/* Custom Range Slider */
.time-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-fast);
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(99, 102, 241, 0.3);
    transition: all var(--transition-fast);
}

.time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 5px rgba(99, 102, 241, 0.4);
}

.time-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(99, 102, 241, 0.3);
    transition: all var(--transition-fast);
}

.time-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
}

/* Quick Time Buttons */
.quick-time-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

.quick-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.quick-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* ========================================
   Result Card
   ======================================== */
.result-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.result-display {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
}

.result-time {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.result-hours,
.result-minutes {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.result-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: var(--spacing-xs);
}

.result-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.result-summary strong {
    color: var(--color-secondary);
    font-weight: 600;
}

/* ========================================
   Timeline
   ======================================== */
.timeline {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.timeline-item.end .timeline-dot {
    background: var(--color-accent);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.timeline-content {
    text-align: center;
}

.timeline-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-time {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-line {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin: 0 var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: var(--radius-full);
    animation: progressPulse 2s infinite ease-in-out;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ========================================
   Tips Card
   ======================================== */
.tips-list {
    list-style: none;
}

.tips-list li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tips-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.tips-list li strong {
    color: var(--color-secondary);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .current-time-display {
        font-size: 2.5rem;
    }

    .result-hours,
    .result-minutes {
        font-size: 2.5rem;
    }

    .time-picker-container {
        gap: var(--spacing-sm);
    }

    .slider-value {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .quick-btn {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card {
    animation: fadeInUp 0.6s ease backwards;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}