:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f5f5f5;
    --text-color: #333;
    --card-background: #fff;
    --tab-active: #3498db;
    --tab-inactive: #ddd;
    --card-border: rgba(0, 0, 0, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.intro {
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
    font-size: 1.1em;
}

.form-container {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.form-container:hover {
    transform: translateY(-5px);
}

.form-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    width: 100px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

button {
    display: block;
    margin: 0 auto;
    padding: 14px 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.stats-container {
    display: none;
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border: 1px solid var(--tab-inactive);
    background-color: var(--tab-inactive);
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.tab:hover:not(.active) {
    background-color: #eee;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    height: 100%;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 12px;
    transition: color 0.3s;
}

.stat-card:hover .stat-value {
    color: var(--secondary-color);
}

.stat-description {
    font-size: 16px;
    line-height: 1.5;
}

.age-display {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: bold;
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    animation: pulse-light 3s infinite;
}

.live-indicator-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background-color: var(--card-background);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.live-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

.live-text {
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-light {
    0% {
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
    }
    50% {
        box-shadow: 0 5px 25px rgba(52, 152, 219, 0.3);
    }
    100% {
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
    }
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #777;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .form-group {
        flex-direction: column;
        align-items: center;
    }

    .input-group {
        width: 100%;
        max-width: 200px;
    }

    .form-group input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .age-display {
        font-size: 20px;
        padding: 15px;
    }

    .stat-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .tab {
        padding: 10px 15px;
        font-size: 14px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-description {
        font-size: 14px;
    }

    .age-display {
        font-size: 16px;
    }
}