/* Clean Light Dashboard Theme - Based on EduLearn Aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --bg-main: #f4f7fe;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    
    --text-dark: #2b3674;
    --text-muted: #a3aed1;
    --text-light: #ffffff;
    
    --primary: #007bff; /* Bright blue */
    --primary-hover: #0056b3;
    
    --accent-yellow: #ffc107;
    --accent-red: #ff4d4f;
    --accent-teal: #20c997;
    --accent-blue: #0dcaf0;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.05);
}

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

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

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff4d4f, #007bff, #20c997);
    border-radius: 8px;
    display: inline-block;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-item:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--bg-main);
    color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    background-color: currentColor;
    border-radius: 4px;
    opacity: 0.7;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* --- NAVBAR --- */
.navbar {
    height: 80px;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    width: 300px;
    box-shadow: var(--shadow-sm);
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    margin-left: 0.5rem;
    color: var(--text-dark);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
    font-weight: bold;
    border: none;
    transition: 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- DASHBOARD CONTENT --- */
.dashboard-container {
    padding: 1rem 2rem 2rem 2rem;
}

/* Banner */
.welcome-banner {
    background: linear-gradient(to right, #48bca2, #2ca58d);
    border-radius: 20px;
    padding: 2.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.banner-content h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.banner-content p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Cards Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
}

.view-all {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Activity Card */
.activity-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-card {
    background-color: #f4f7fe;
    color: var(--primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

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

/* Status variants */
.activity-card.locked {
    opacity: 0.6;
    background-color: #f8fafc;
}
.activity-card.locked .card-icon { background-color: #cbd5e1; }
.activity-card.locked .btn-card { display: none; }

.activity-card.unlocked {
    border-color: rgba(0, 123, 255, 0.2);
}
.activity-card.unlocked .card-icon { background-color: var(--primary); }

.activity-card.completed {
    background-color: white;
}
.activity-card.completed .card-icon { background-color: var(--accent-teal); }
.activity-card.completed .btn-card { 
    background-color: rgba(32, 201, 151, 0.1); 
    color: var(--accent-teal); 
    pointer-events: none;
}

/* Colors for sequential activities based on nth-child logic handled in JS */
.icon-color-1 { background-color: var(--accent-yellow) !important; }
.icon-color-2 { background-color: var(--accent-red) !important; }
.icon-color-3 { background-color: var(--accent-teal) !important; }
.icon-color-4 { background-color: var(--accent-blue) !important; }
.icon-color-5 { background-color: var(--primary) !important; }

/* --- LOGIN PAGE STYLES --- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
}

.login-box {
    background-color: white;
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-box h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

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

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out forwards;
}

.toast.error { background: var(--accent-red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- CARDS & FORMS --- */
.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.p-4 { padding: 1.5rem; }
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- MODAL --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px);
}
.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover,
.close-modal:focus {
    color: var(--text-dark);
    text-decoration: none;
}
.quiz-question {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.quiz-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}
