/* ============================================
   AGE CALCULATOR - FIGMA LEVEL CSS
   Version 1.0
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Reset */
.age-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.age-wrap {
    --violet:      #7C3AED;
    --violet-dark: #5B21B6;
    --pink:        #EC4899;
    --pink-dark:   #BE185D;
    --orange:      #F59E0B;
    --green:       #10B981;
    --grad:        linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    --grad-soft:   linear-gradient(135deg,
                   rgba(124,58,237,0.07) 0%,
                   rgba(236,72,153,0.07) 100%);
    --white:       #FFFFFF;
    --bg:          #FAF5FF;
    --border:      rgba(124,58,237,0.14);
    --text:        #1A1A2E;
    --text-muted:  #6B7280;
    --shadow:      0 32px 80px rgba(124,58,237,0.18),
                   0 8px 24px rgba(236,72,153,0.10);
    --shadow-btn:  0 12px 32px rgba(124,58,237,0.40);
    --radius-xl:   24px;
    --radius-lg:   16px;
    --radius-md:   12px;
    --radius-sm:   8px;
    font-family: 'Inter', sans-serif;
    position: relative;
    padding: 40px 16px;
    background: var(--bg);
}

/* Blobs */
.age-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}
.age-blob-1 {
    width: 300px; height: 300px;
    background: rgba(124,58,237,0.10);
    top: -80px; left: -80px;
}
.age-blob-2 {
    width: 250px; height: 250px;
    background: rgba(236,72,153,0.09);
    bottom: 20px; right: -60px;
}
.age-blob-3 {
    width: 180px; height: 180px;
    background: rgba(245,158,11,0.07);
    top: 45%; left: 45%;
}

/* Card */
.age-card {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Header */
.age-header {
    background: var(--grad);
    padding: 26px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.age-header::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -80px; right: -50px;
}

.age-header::before {
    content: '';
    position: absolute;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -40px; left: 30%;
}

.age-header-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}

.age-header-text h2 {
    color: white;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.age-header-text p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    margin-top: 3px;
}

/* Body */
.age-body {
    padding: 30px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Step Label */
.age-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.age-step-num {
    width: 26px; height: 26px;
    background: var(--grad);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(124,58,237,0.35);
}

.age-step-label span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Date Input */
.age-date-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.age-date-icon {
    position: absolute;
    left: 14px;
    color: var(--violet);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.age-date-wrap input[type="date"] {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text);
    background: #FAFAFF;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.25s ease;
    outline: none;
}

.age-date-wrap input[type="date"]:focus {
    border-color: var(--violet);
    background: white;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.08);
}

.age-date-wrap input[type="date"]:hover {
    border-color: rgba(124,58,237,0.30);
}

/* Toggle Buttons */
.age-toggle-wrap {
    display: flex;
    gap: 8px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.age-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.age-toggle-btn:hover {
    color: var(--violet);
}

.age-toggle-active {
    background: white !important;
    color: var(--violet) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* Calculate Button */
#age_btn {
    width: 100%;
    padding: 15px 24px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
}

#age_btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.15),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s;
}

#age_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(124,58,237,0.45);
}

#age_btn:hover::before { opacity: 1; }
#age_btn:active { transform: translateY(0); }

.age-btn-icon {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.20);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Result Section */
.age-result {
    display: none;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.45s cubic-bezier(0.34,1.56,0.64,1);
    flex-direction: column;
    gap: 16px;
}

.age-result-visible {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Main Age Display */
.age-main-display {
    background: var(--grad);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(124,58,237,0.25);
}

.age-main-display::before {
    content: '';
    position: absolute;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -60px; right: -40px;
}

.age-main-display::after {
    content: '';
    position: absolute;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -30px; left: -20px;
}

.age-main-inner {
    position: relative;
    z-index: 1;
}

.age-birthday-icon {
    font-size: 40px;
    margin-bottom: 10px;
    line-height: 1;
}

.age-years-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.age-years-num {
    font-size: 72px;
    font-weight: 900;
    color: white;
    letter-spacing: -3px;
    line-height: 1;
}

.age-years-label {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.80);
    letter-spacing: -0.3px;
}

.age-next-bday {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    color: white;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}

/* Detail Grid */
.age-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.age-detail-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 10px;
    text-align: center;
    transition: all 0.25s ease;
}

.age-detail-card:hover {
    border-color: var(--violet);
    box-shadow: 0 6px 20px rgba(124,58,237,0.10);
    transform: translateY(-3px);
}

.age-detail-icon {
    font-size: 20px;
    margin-bottom: 8px;
    line-height: 1;
}

.age-detail-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    line-height: 1;
    word-break: break-all;
}

.age-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Extra Info Grid */
.age-extra-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.age-extra-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
}

.age-extra-card:hover {
    border-color: var(--violet);
    box-shadow: 0 4px 16px rgba(124,58,237,0.10);
    transform: translateX(3px);
}

.age-extra-icon {
    font-size: 24px;
    width: 40px; height: 40px;
    background: var(--grad-soft);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.age-extra-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.age-extra-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--violet);
    line-height: 1.2;
}

/* Footer */
.age-footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 32px 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    background: #FAFAFF;
}

.age-footer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--violet);
}

/* Tablet */
@media (max-width: 600px) {
    .age-wrap {
        padding: 20px 10px;
    }
    .age-card {
        border-radius: var(--radius-lg);
    }
    .age-header {
        padding: 22px 20px;
    }
    .age-body {
        padding: 24px 20px;
    }
    .age-footer {
        padding: 14px 20px 20px;
    }
    .age-years-num {
        font-size: 56px;
    }
    .age-years-label {
        font-size: 16px;
    }
    .age-detail-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .age-detail-value {
        font-size: 13px;
    }
    .age-extra-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 400px) {
    .age-years-num {
        font-size: 48px;
    }
    .age-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .age-header-text h2 {
        font-size: 18px;
    }
    .age-toggle-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
