@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #0ea5e9;
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
}

* {
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-links a,
.nav-links span {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1,
h2 {
    color: var(--text-main);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.75rem;
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 450px;
    margin: 2rem auto;
}

input,
select,
textarea {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: #f8fafc;
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: white;
}

/* Buttons */
button[type="submit"],
.btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

button[type="submit"]:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

button[type="submit"]:active,
.btn:active {
    transform: translateY(0);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border);
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Status & Alerts */
.status-submitted {
    color: #d97706;
    background-color: #fef3c7;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-graded {
    color: #059669;
    background-color: #d1fae5;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.error {
    color: #ef4444;
    background-color: #fee2e2;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #fecaca;
}

.success {
    color: #10b981;
    background-color: #d1fae5;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #a7f3d0;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Gamification Levels */
.level-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin-left: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.level-master {
    color: #fef3c7;
    border-color: #fcd34d;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.level-expert {
    color: #fbcfe8;
    border-color: #f472b6;
}

.level-intermediate {
    color: #bae6fd;
    border-color: #7dd3fc;
}

.level-beginner {
    color: #e2e8f0;
    border-color: #cbd5e1;
}

/* Leaderboard Enhancements */
.rank-1 {
    background-color: #fffbeb !important;
    /* Gold Tint */
    border-left: 4px solid #f59e0b;
}

.rank-2 {
    background-color: #f8fafc !important;
    /* Silver Tint */
    border-left: 4px solid #94a3b8;
}

.rank-3 {
    background-color: #fff1f2 !important;
    /* Bronze Tint */
    border-left: 4px solid #b91c1c;
}


/* --- Glassmorphism Login Design --- */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-container-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header h2 {
    color: white;
    text-align: center;
    border: none;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 0;
}

.glass-form .input-group {
    margin-bottom: 1.5rem;
}

.glass-form label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.glass-form input {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.glass-form input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.glass-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-glass {
    width: 100%;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.form-footer a {
    color: #c4b5fd;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
    color: white;
}

/* Glass Alerts */
.error-glass {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success-glass {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}