:root {
    --primary-color: #4203a9;
    --secondary-color: #90bafc;
    --accent-color: #ffff76;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --text-color: #e94560;
    --card-bg: rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    overflow-x: hidden;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0; }
    50% { transform: translateY(-100px) rotate(180deg); opacity: 1; }
}

.container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.calculator {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    padding: 20px;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-btn {
    background: var(--card-bg);
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    transform: scale(1.1);
    background: var(--hover-bg);
}

.calculator h1 {
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

.calculator h1 span {
    color: var(--accent-color);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-box {
    margin: 40px 0;
    padding: 35px;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    animation: fadeIn 1s ease 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.input-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 18px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    transition: var(--transition);
}

.input-box input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.input-box button {
    background: var(--accent-color);
    border: none;
    outline: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.input-box button:hover {
    background: #ffeb3b;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.input-box button:active {
    transform: translateY(-1px) scale(1.02);
}

.result-card {
    margin: 30px 0;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    animation: slideInUp 0.6s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

#ageDisplay {
    font-size: 24px;
    line-height: 1.6;
}

.birthday-countdown {
    margin: 30px 0;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    animation: slideInUp 0.6s ease 0.2s both;
}

.birthday-countdown h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.countdown-item {
    background: var(--hover-bg);
    padding: 20px;
    border-radius: 15px;
    min-width: 100px;
    transition: var(--transition);
}

.countdown-item:hover {
    transform: scale(1.05);
    background: var(--accent-color);
    color: #333;
}

.countdown-item span {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
}

.countdown-item label {
    display: block;
    font-size: 14px;
    margin-top: 5px;
    opacity: 0.8;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #ff6b6b);
    border-radius: 4px;
    transition: width 1s ease;
}

.time-cards {
    margin-top: 40px;
    animation: fadeIn 1s ease 0.4s both;
}

.time-cards h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--accent-color);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.6s ease both;
}

.card:nth-child(n) {
    animation-delay: calc(0.1s * var(--i));
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    background: var(--hover-bg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.card-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
    transition: var(--transition);
}

.card:hover .card-value {
    transform: scale(1.1);
}

.card-label {
    font-size: 14px;
    opacity: 0.8;
}

.pulse {
    animation: pulse 2s infinite;
}
