:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --success: #00B894;
    --danger: #FF7675;
    --warning: #FDCB6E;
    --warning-light: #FFEAA7;
    --dark: #2D3436;
    --text: #2D3436;
    --text-muted: #636E72;
    --bg-gradient: linear-gradient(135deg, #f3eafd 0%, #e8f5fb 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --border: rgba(255, 255, 255, 0.6);
}

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

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
}

.glass-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
}

.glass-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.glass-header p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background: #5A4FCF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-warning { background: var(--warning); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    text-align: center;
}

.login-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* Task Cards */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.2s;
    border-left: 5px solid var(--primary);
}

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

.task-card.completed {
    border-left-color: var(--success);
    opacity: 0.8;
}

.task-card.review-pending {
    border-left-color: var(--warning);
    background: #fffcf5;
}

.task-details h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--dark);
}

.task-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Timer */
.timer-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.timer-box {
    text-align: center;
    padding: 40px;
    width: 90%;
    max-width: 400px;
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    margin: 20px 0;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: var(--danger); }
    100% { transform: scale(1); }
}

/* Admin / Upload */
.upload-area {
    border: 2px dashed var(--primary-light);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    background: rgba(162, 155, 254, 0.1);
}

/* Results Form */
.results-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.results-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

.results-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-align: center;
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

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

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-gradient);
}
.badge.success { background: rgba(0, 184, 148, 0.1); color: var(--success); }
.badge.danger { background: rgba(255, 118, 117, 0.1); color: var(--danger); }
.badge.warning { background: rgba(253, 203, 110, 0.2); color: #d35400; }

/* Report Table */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.report-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-top: 4px solid var(--primary);
}

.report-card h3 {
    margin-bottom: 15px;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-bottom: 1px dashed #eee;
    padding-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--dark);
}

/* Optic Form System */
.optic-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.optic-box {
    background: var(--card-bg);
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    padding: 30px;
    border-radius: 20px;
    overflow-y: auto;
    text-align: center;
}

.optic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
    text-align: left;
}

.optic-question {
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.optic-q-num {
    font-weight: bold;
    color: var(--primary);
    width: 30px;
}

.optic-options {
    display: flex;
    gap: 5px;
}

.optic-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.optic-option:hover {
    border-color: var(--primary-light);
    background: #f8f9fa;
}

.optic-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.4);
}

.optic-option.empty-btn {
    width: auto;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Parent Review System */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 15px 0 25px;
}

.review-item {
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
}

.review-item h4 {
    font-size: 1.1rem;
    color: var(--dark);
    margin: 0;
}

.review-item .ans {
    font-size: 1.2rem;
    font-weight: bold;
    background: white;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--dark);
}

/* Review Statuses */
.review-item[data-status="correct"] {
    background: rgba(0, 184, 148, 0.15);
    border-color: var(--success);
}
.review-item[data-status="correct"] .ans { color: var(--success); }

.review-item[data-status="wrong"] {
    background: rgba(255, 118, 117, 0.15);
    border-color: var(--danger);
}
.review-item[data-status="wrong"] .ans { color: var(--danger); }

.review-item[data-status="empty"] {
    background: #eee;
    border-color: #ccc;
    opacity: 0.7;
}
.review-item[data-status="empty"] .ans { color: #888; font-size: 0.8rem; }


/* Admin / User Management */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.user-card {
    padding: 20px;
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-info h3 {
    font-size: 1.1rem;
    color: var(--primary);
}

.user-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-actions {
    display: flex;
    gap: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: inherit;
}

.multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.select-item {
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.select-item.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Student Selector for Parent */
.student-selector {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    overflow-x: auto;
    padding-bottom: 10px;
}

.student-tab {
    padding: 10px 20px;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
    transition: all 0.3s;
    font-weight: 600;
}

.student-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.student-tab:hover:not(.active) {
    border-color: var(--primary-light);
}
