:root {
    --primary: #8e44ad;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #2ecc71;
    --glow: #f1c40f;
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(300deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(142, 68, 173, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to allow top alignment when scrolling */
    overflow-y: auto;
    /* Changed from hidden */
    padding: 40px 0;
    /* Added padding for top/bottom breathing room */
    position: relative;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Background Floating Shapes */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatShape 20s infinite alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), transparent);
    animation-delay: -5s;
}

.shape-3 {
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent), transparent);
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

.container {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    z-index: 10;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 50px 30px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

/* Reflective Shine on Card */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
}

.card:hover::after {
    left: 200%;
    transition: 1s;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.main-logo {
    width: 100%;
    max-width: 450px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.voice-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 8px;
    -webkit-text-fill-color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.input-group {
    margin-bottom: 35px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

input[type="date"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    transition: 0.3s;
    color-scheme: dark;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

input[type="date"]:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.voice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    width: 60px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.4rem;
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
}

.voice-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

.voice-btn.listening {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    animation: ripple 1.5s infinite;
}

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(231, 76, 60, 0);
    }
}

.hint {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    text-align: center;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 20px;
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 35px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.calculate-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(142, 68, 173, 0.5);
}

/* Button Shine Effect */
.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
}

.calculate-btn:hover::before {
    left: 100%;
}

.result {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.secondary-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.result-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.small-card {
    padding: 15px 10px;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.counter {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff, #dfe6e9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.small-counter {
    font-size: 1.5rem;
}

.label {
    font-size: 0.85rem;
    color: var(--glow);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

.small-label {
    font-size: 0.75rem;
    color: var(--secondary);
}

.status-message {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--accent);
    min-height: 24px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
    transition: color 0.3s;
}

.status-message.success {
    color: var(--success);
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.status-message.error {
    color: var(--accent);
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .card {
        padding: 30px 20px;
    }

    .counter {
        font-size: 1.8rem;
    }
}

.footer {
    display: block;
    margin: 30px auto 0;
    /* Reduced from 40px */
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    /* Slightly more opaque */
    letter-spacing: 1px;
    text-transform: none;
    font-weight: 400;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* Slightly stronger */
    padding-top: 15px;
    /* Reduced from 20px */
    width: 85%;
}

.owner-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    margin-left: 8px;
    background: linear-gradient(135deg, #fff, var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 0 5px rgba(52, 152, 219, 0.5));
    transition: transform 0.3s ease;
}

.owner-signature:hover {
    transform: scale(1.1) rotate(-2deg);
}