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

:root {
    --primary: #22c55e;
    --primary-glow: rgba(34, 197, 94, 0.5);
    --bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(34, 197, 94, 0.15);
}

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

body {
    background: var(--bg);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: bg-breathe 12s ease-in-out infinite;
}

@keyframes bg-breathe {
    0%, 100% { background: #000000; }
    50% { background: #010d04; }
}

.grid-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(34,197,94,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,197,94,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: #94a3b8;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.btn-green {
    width: 100%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

.btn-green:active {
    transform: translateY(0);
}

.btn-green:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.student-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.status-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.error {
    color: #ef4444;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1rem;
    display: none;
}

.congrats-text {
    display: none;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 1.5rem 0;
    color: #fff;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.highlight-name {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0.5rem 0;
    background: linear-gradient(to right, #22c55e, #4ade80, #facc15);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

footer {
    margin-top: 4rem;
    color: #475569;
    font-size: 0.75rem;
    text-align: center;
    padding-bottom: 2rem;
}

.stats-container {
    margin-top: 2rem;
    max-width: 500px;
}

.stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.stats-header h2 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.stats-header p {
    font-size: 0.8rem;
    color: #64748b;
}

.stats-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.chart-box {
    flex: 1;
    text-align: center;
}

.chart-box p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.stats-grid {
    flex: 1.5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item .label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.stat-item .value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.color-green { color: #22c55e; }
.color-red { color: #ef4444; }

.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 100px;
    max-height: 100px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
}

@keyframes progress {
    0% { stroke-dasharray: 0 100; }
}

.circular-chart.green .circle {
    stroke: #22c55e;
}

.percentage {
    fill: #fff;
    font-family: 'JetBrains Mono', sans-serif;
    font-size: 0.5rem;
    font-weight: 700;
    text-anchor: middle;
}

.fade-up {
    animation: fadeIn 0.8s ease-out forwards;
}

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

.age-distribution {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.age-item {
    margin-bottom: 1rem;
}

.age-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.age-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.age-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 999px;
    animation: slideRight 1.5s ease-out forwards;
}

@keyframes slideRight {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.failed-list-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.failed-list-section h3 {
    font-size: 0.9rem;
    color: #ef4444;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.failed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.failed-item {
    display: flex;
    justify-content: space-between;
    background: rgba(239, 68, 68, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.failed-item span:first-child {
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
}

.failed-item span:last-child {
    font-weight: 600;
    color: #f8fafc;
}
