:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-base: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.75);
    --border: rgba(255, 255, 255, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 16px; /* For mobile padding */
}

/* Dynamic Animated Background - Light Theme */
.background-animation {
    position: fixed; 
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.12) 0%, transparent 40%);
    animation: drift 20s infinite alternate ease-in-out;
    z-index: 0;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, -5%) scale(1.1); }
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 28px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Glassmorphism Effect for Light Theme */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.1), inset 0 1px 1px rgba(255,255,255,0.9);
}

.glass-inner {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

header {
    margin-bottom: 35px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #4f46e5, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 400;
}

.step {
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.step.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input {
    width: 100%;
    padding: 16px;
    font-family: inherit;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.time-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    background: #ffffff;
}

.time-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.time-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1.15rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.primary-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.5);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px -6px rgba(99, 102, 241, 0.7);
}

.primary-btn:active {
    transform: translateY(1px);
}

.time-display {
    padding: 20px;
}

.label {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.time-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

h3 {
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
}

.duration-options {
    display: flex;
    gap: 16px;
}

.duration-btn {
    flex: 1;
    padding: 18px 10px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.duration-btn:hover {
    background: #ffffff;
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.duration-btn:active {
    transform: translateY(1px);
}

.result-card {
    padding: 30px 20px;
}

.result-card h3 {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.time-highlight {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.secondary-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 1rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.8);
}

.text-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 0.95rem;
    margin-top: 8px;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.text-btn:hover {
    color: var(--primary);
}

.history-list {
    max-height: 220px;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
}

.history-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.95rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date { 
    color: #4f46e5; 
    display: block; 
    font-weight: 700;
    font-size: 0.85rem; 
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-details { 
    color: var(--text-main); 
    font-weight: 500; 
}

/* Animations */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-in {
    animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        border-radius: 24px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .time-input {
        font-size: 1.6rem;
    }

    .time-value {
        font-size: 1.8rem;
    }

    .time-highlight {
        font-size: 2.8rem;
    }

    .duration-options {
        flex-direction: column;
        gap: 12px;
    }
}

.footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
