
:root {
    --bg-light: #fef6e4; /* Soft cream background */
    --bg-dark: #001524; /* Deep navy background */
    --text-light: #272343; /* Muted black text */
    --text-dark: #e3f6f5; /* Soft white text */
    --primary: #ff8906; /* Vibrant orange */
    --accent: #9b5de5; /* Bright violet */
}

/* Body Styling */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--bg-light), #fdfcdc);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    transition: background 0.3s, color 0.3s;
    overflow: hidden;
}

.dark-theme {
    background: linear-gradient(135deg, var(--bg-dark), #0f3d57);
    color: var(--text-dark);
}

/* Calculator Container */
.age-calculator {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: fadeIn 1s ease-in-out;
}

.dark-theme .age-calculator {
    background: var(--bg-dark);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Fade-In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Styling */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px var(--primary);
    outline: none;
}

/* Button Styling */
button {
    padding: 12px 20px;
    margin: 5px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}

button:hover {
    background: #e07b04; /* Slightly darker orange */
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Theme Toggle */
.theme-toggle {
    margin-top: 15px;
    text-decoration: none;
    background: none;
    border: 2px solid var(--accent);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--accent);
    transition: color 0.3s, background 0.3s, transform 0.2s;
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* Result Display */
.result {
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Footer Styling */
footer {
    margin-top: 30px;
    font-size: 14px;
    text-align: center;
    color: var(--text-light);
}

.dark-theme footer {
    color: var(--text-dark);
}

/* Date Picker Container */
.date-picker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.date-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: bold;
}

/* Modern Date Picker */
.modern-date-picker {
    appearance: none; /* Remove default browser styling */
    -webkit-appearance: none; /* Safari-specific */
    background-color: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
    color: var(--text-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 250px;
    cursor: pointer;
}

.modern-date-picker:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    outline: none;
}

/* Styling the dropdown caret */
.modern-date-picker::-webkit-calendar-picker-indicator {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23ff8906" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    opacity: 1;
}

.dark-theme .modern-date-picker {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--text-dark);
}

.dark-theme .modern-date-picker:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

