:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #8b5cf6;
    /* Violet */
    --secondary: #ec4899;
    /* Pink */
    --accent: #06b6d4;
    /* Cyan */
    --text: #ffffff;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Background Animation */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--secondary);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: var(--accent);
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Main Glass Container */
.glass-container {
    width: 100%;
    max-width: 500px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.badge {
    font-size: 0.8rem;
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 5px;
    vertical-align: middle;
    color: #000;
}

.header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

/* Inputs */
.inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.row-group {
    display: flex;
    gap: 15px;
}

.input-glass {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.full-width {
    width: 100%;
}

label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.input-icon-group {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 12px;
}

.input-icon-group i {
    color: var(--accent);
    margin-right: 10px;
}

.input-icon-group input {
    border: none;
    background: transparent;
    padding: 12px 0;
}

input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: white;
    outline: none;
    font-family: inherit;
    width: 100%;
    transition: 0.3s;
    color-scheme: dark;
}

input:focus {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.1);
}

/* Calculate Button */
#calc-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

#calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

/* History Section */
.history-container {
    margin-top: 20px;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.history-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.history-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.history-item:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.delete-history {
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Results */
.result-wrapper {
    margin-top: 25px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.5s;
}

.result-wrapper.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* View Toggles */
.view-toggles {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.toggle-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.6);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-btn.active,
.toggle-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Cards */
.age-display {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.glass-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 16px;
    text-align: center;
}

.number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary);
    display: block;
}

.label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* Extras */
.extras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
}

.info-card .icon {
    font-size: 1.2rem;
    color: var(--primary);
}

.value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Share Button */
.share-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.share-btn:hover {
    background: var(--accent);
    color: #000;
}

.error-msg {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .row-group {
        flex-direction: column;
    }

    .extras-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 15px;
    }
}.hidden {
    display: none !important;
}

.result-wrapper {
    margin-top: 25px;
    display: none; /* Defaults to none */
    opacity: 0;
    transform: translateY(10px);
    transition: 0.5s;
}

.result-wrapper.show {
    display: block; /* Changes to block when shown */
    opacity: 1;
    transform: translateY(0);
}