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

:root {
    --primary: #0EA5E9;
    /* Light Blue / Sky 500 */
    --primary-hover: #0284C7;
    /* Sky 600 */
    --secondary: #334155;
    /* Slate 700 */
    --success: #10B981;
    --danger: #EF4444;
    --background: #F0F9FF;
    /* Sky 50 */
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #0F172A;
    /* Slate 900 */
    --text-muted: #64748B;
    --border: #E0F2FE;
    /* Sky 100 */
    --shadow-sm: 0 4px 6px -1px rgba(14, 165, 233, 0.05);
    --shadow-lg: 0 20px 40px -5px rgba(14, 165, 233, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--background);
    background-image:
        radial-gradient(at 0% 0%, hsla(199, 89%, 48%, 0.04) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(200, 98%, 39%, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(199, 89%, 48%, 0.04) 0, transparent 50%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
}

.container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Decorations */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #38BDF8, #0EA5E9);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -0.05em;
}

p.description {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--secondary);
}

.card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #BAE6FD;
}

.card ul {
    margin-left: 0;
    list-style: none;
}

.card ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 15px;
}

.card ul li i {
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--primary);
    font-size: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    width: 100%;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

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

.btn-primary:disabled {
    background: #94A3B8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #1E293B;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 65, 85, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
}

.link:hover {
    color: var(--primary-hover);
}

.link i {
    transition: transform 0.2s;
}

.link:hover i {
    transform: translateX(4px);
}

/* Form Styles */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 20px;
    transition: color 0.3s;
}

input[type="number"],
input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 16px 16px 16px 48px;
    font-size: 16px;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    transition: all 0.3s ease;
    outline: none;
    background: #FFF;
    color: var(--text-main);
    font-weight: 500;
}

input[type="file"] {
    padding: 12px;
}

/* Standard Number Input fallback */
input[type="number"] {
    text-align: left;
    -moz-appearance: textfield;
}

/* Big Answer Input styling for test page */
#answerForm .input-group input[type="number"] {
    text-align: center;
    padding: 16px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
}

#answerForm .input-group i {
    display: none;
    /* Hide icon inside answer field */
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.input-group input:focus+i {
    color: var(--primary);
}

/* Admin specific inputs without icons */
.admin-form .input-group input {
    padding-left: 16px;
}

/* Image Plate */
.plate-container {
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 280px;
    margin: 0 auto 32px auto;
    background: #FFF;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 0 0 8px #F8FAFC;
    border: 1px solid #E2E8F0;
    transition: transform 0.3s ease;
}

.plate-container:hover {
    transform: scale(1.02);
}

.plate-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.plate-container .no-image {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Timer and Progress */
.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.badge-plate {
    background: #E0F2FE;
    color: var(--primary-hover);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.timer {
    background: #FFF1F2;
    color: var(--danger);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #E0F2FE;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Progress bar */
.progress-rail {
    height: 8px;
    background: #F1F5F9;
    border-radius: 4px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #38BDF8, #0EA5E9);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #FFF;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #F8FAFC;
}

.badge {
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.rank-1,
.rank-2,
.rank-3 {
    font-weight: 800;
}

.rank-1 {
    color: #F59E0B;
}

/* Gold */
.rank-2 {
    color: #94A3B8;
}

/* Silver */
.rank-3 {
    color: #B45309;
}

/* Bronze */

/* Score specific */
.score-display {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #38BDF8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    line-height: 1;
}

@media (max-width: 480px) {
    .container {
        padding: 32px 24px;
        border-radius: 20px;
    }

    h1 {
        font-size: 26px;
    }

    .plate-container {
        max-width: 220px;
    }
}