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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

a {
    color: #5a67d8;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Login / Profile centered cards */
.login-container, .profile-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-card, .profile-container .card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.login-card h1, .profile-container h2 {
    margin-bottom: 30px;
    color: #4a5568;
}

.login-card label, .profile-container label {
    display: block;
    text-align: left;
    margin-bottom: 15px;
    font-weight: 500;
    color: #4a5568;
}

.login-card input, .profile-container input {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
}

.login-card button, .profile-container button {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.login-card button:hover, .profile-container button:hover {
    background: #5a67d8;
}

.error {
    color: #e53e3e;
    margin-bottom: 15px;
    font-size: 14px;
}

.message {
    background: #c6f6d5;
    color: #276749;
    padding: 12px 25px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Admin and home containers */
.admin-container, .home-container {
    width: 95%;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.admin-header, .home-header {
    background: #f7fafc;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.user-bar, .header-actions {
    font-size: 14px;
    display: flex;
    gap: 15px;
}

.role-badge {
    background: #667eea;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.role-badge.admin {
    background: #ed8936;
}

.subject-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
}
.subject-tabs a {
    padding: 8px 20px;
    background: #edf2f7;
    border-radius: 20px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
}
.subject-tabs a.active {
    background: #667eea;
    color: white;
}

.admin-content, .subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding: 25px 30px;
}

@media (max-width: 800px) {
    .admin-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.card h2, .card h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 20px;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inline-form input[type="text"],
.inline-form input[type="password"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Buttons */
button, .btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}
button:hover, .btn:hover {
    background: #5a67d8;
}
.btn-danger {
    background: #fc8181;
}
.btn-danger:hover {
    background: #f56565;
}
.btn-sm {
    font-size: 13px;
    padding: 4px 12px;
}
.btn-primary {
    background: #667eea;
    color: white;
}

.item-list {
    list-style: none;
    padding: 0;
}
.item-list li {
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tables */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.user-table th, .user-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}
.user-table th {
    background: #edf2f7;
    font-weight: 600;
}

/* Quiz page */
.quiz-container {
    width: 95%;
    max-width: 700px;
    margin: 30px auto;
}
.quiz-header {
    background: rgba(255,255,255,0.9);
    padding: 15px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.remaining-panel {
    background: rgba(255,255,255,0.8);
    padding: 10px 25px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}
.remaining-panel summary {
    cursor: pointer;
    outline: none;
    font-weight: 500;
}
.remaining-panel ul {
    margin-top: 8px;
    list-style: disc;
    padding-left: 20px;
    max-height: 150px;
    overflow-y: auto;
}
.quiz-card {
    background: white;
    padding: 50px 30px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    text-align: center;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.question-text {
    font-size: 26px;
    line-height: 1.8;
    margin-bottom: 50px;
    color: #2d3748;
    word-break: break-word;
}
.button-group {
    display: flex;
    gap: 30px;
    justify-content: center;
}
.btn-know, .btn-dontknow {
    font-size: 22px;
    padding: 18px 60px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn-know {
    background: #48bb78;
    color: white;
}
.btn-know:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(72,187,120,0.4);
}
.btn-dontknow {
    background: #ed8936;
    color: white;
}
.btn-dontknow:hover {
    background: #dd6b20;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(237,137,54,0.4);
}

.complete h2 {
    font-size: 30px;
    color: #38a169;
    margin-bottom: 20px;
}
.complete p {
    font-size: 20px;
    color: #718096;
    margin-bottom: 30px;
}
.btn-restart {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
}

/* Clipboard layout (desktop only) */
.clipboard-layout {
    display: flex;
    max-width: 1100px;
    margin: 30px auto;
    gap: 20px;
}
.left-panel {
    flex: 0 0 280px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.right-panel {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-height: 400px;
}