:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #ec4899; /* Pink for contrast */
    --accent: #8b5cf6; /* Violet */
    --background: #0f172a; /* Dark mode base for better glass contrast */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dark: #1e293b; /* For inside white inputs if needed */
    --danger: #ef4444;
    --success: #10b981;
    --radius: 24px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Animated Mesh Gradient Background */
    background: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.33) 0px, transparent 50%),
        radial-gradient(at 98% 1%, rgba(236, 72, 153, 0.33) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.33) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.33) 0px, transparent 50%),
        #0f172a;
    background-attachment: fixed;
}

/* Floating Blobs Animation */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite alternate ease-in-out;
}

body::before {
    background: var(--primary);
    top: -50px;
    left: -50px;
}

body::after {
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism Header */
header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(165, 180, 252, 0.5);
}

header h1 a {
    text-decoration: none;
    /* Inherits gradient from h1 */
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Main Glass Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

h2 {
    margin-top: 0;
    color: white;
    font-weight: 800;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

h3 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.5rem;
}

/* Inputs with Glass Style */
input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px var(--primary-glow);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Neon Buttons */
button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

button:hover::after {
    left: 100%;
}

button.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

button.secondary:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

/* Lists */
.quiz-list, .subject-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.quiz-list li, .subject-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.quiz-list li:hover, .subject-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.quiz-list li a, .subject-list li a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    font-size: 1.1rem;
}

.quiz-list li a::after, .subject-list li a::after {
    content: '→';
    font-weight: 900;
    opacity: 0.5;
    transform: translateX(0);
    transition: all 0.3s;
}

.quiz-list li:hover a::after, .subject-list li:hover a::after {
    opacity: 1;
    transform: translateX(5px);
    color: var(--primary);
}

/* Quiz Specifics */
.question-card {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
}

.choices {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 16px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 1.1rem;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.choice-btn::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    margin-right: 15px;
    transition: all 0.2s;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.choice-btn.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.choice-btn.selected::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.choice-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--success) !important;
    color: #6ee7b7 !important;
}

.choice-btn.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--danger) !important;
    color: #fca5a5 !important;
}

#score-display {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    color: white;
    margin: 2rem 0;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 30px rgba(255,255,255,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Utility */
.hidden {
    display: none !important;
}

.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid var(--danger);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid var(--success);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 2rem 0;
}

/* File Input Styling */
input[type="file"] {
    background: rgba(255,255,255,0.05);
    padding: 2rem;
    border: 2px dashed rgba(255,255,255,0.2);
    text-align: center;
    height: auto;
}

input[type="file"]:hover {
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}
