:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f8fafc;
    --text-color: #1e293b;
    --success-color: #10b981;
    --error-color: #f43f5e;
    --nav-bg: #ffffff;
    --nav-text: #1e293b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #f1f5f9 0%, #f8fafc 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--nav-text);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.btn-logout {
    border: 1px solid var(--nav-text);
    padding: 5px 15px;
    border-radius: 4px;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

h1,
h2,
h3 {
    color: #333;
    margin-bottom: 20px;
}

/* Typography Helpers */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Forms */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    max-width: 400px;
    margin: 20px auto;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

button,
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

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

.btn-success:hover {
    background-color: #27ae60;
}

/* Cards & Grid */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.question-card,
.result-card {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

/* History */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    overflow: hidden;
}

.history-table th,
.history-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

/* Questions */
.options label {
    display: block;
    margin: 12px 0;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s;
}

.options label:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
}

.options input[type="radio"] {
    margin-right: 10px;
}

/* Results */
.score-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.score-card h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
}

.result-card.correct {
    border-left: 6px solid var(--success-color);
}

.result-card.incorrect {
    border-left: 6px solid var(--error-color);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    display: inline-block;
    margin-left: 8px;
}

.badge.success {
    background-color: var(--success-color);
}

.badge.error {
    background-color: var(--error-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: auto;
}

/* Flash Messages */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.flash-messages li {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.flash-messages .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-messages .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-messages .info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}