/**
 * LMS Styles
 * Styles for authenticated LMS pages
 */

/* ========================================
   LMS Navigation
   ======================================== */
.lms-nav {
    background: var(--primary-dark-azure);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand h2 {
    font-family: 'Holiday', serif;
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-orange);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: var(--primary-orange);
}

.nav-link.active {
    background: var(--primary-orange);
    color: var(--dark-azure);
}

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

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

/* ========================================
   LMS Content Area
   ======================================== */
.lms-content {
    min-height: calc(100vh - 70px);
    padding: 2rem 0;
    background: var(--light-orange);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: 'Holiday', serif;
    color: var(--dark-azure);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* ========================================
   Dashboard Components
   ======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

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

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--primary-orange);
}

.stat-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.dashboard-section {
    margin-bottom: 3rem;
}

.dashboard-section h2 {
    font-family: 'Holiday', serif;
    color: var(--dark-azure);
    margin-bottom: 1rem;
}

/* ========================================
   Lesson Cards
   ======================================== */
.lesson-card, .info-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lesson-badge, .week-badge {
    background: var(--primary-orange);
    color: var(--dark-azure);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lesson-body {
    margin-bottom: 1rem;
}

.lesson-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   Curriculum Grid
   ======================================== */
.year-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--dark-azure);
    background: white;
    color: var(--dark-azure);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.tab-button:hover {
    background: var(--light-orange);
}

.tab-button.active {
    background: var(--dark-azure);
    color: white;
}

.progress-overview {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.progress-stats {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-azure);
}

.progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), #ffd700);
    transition: width 0.5s ease;
}

.progress-percent {
    text-align: right;
    font-weight: 600;
    color: var(--primary-orange);
}

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

.curriculum-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.curriculum-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.curriculum-card.completed {
    border: 2px solid #4caf50;
}

.curriculum-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.curriculum-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.status-badge.completed {
    background: #4caf50;
    color: white;
}

.status-badge.locked {
    background: #999;
    color: white;
}

/* ========================================
   Reflection Form
   ======================================== */
.reflection-section {
    margin-bottom: 3rem;
}

.reflection-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dimension-card {
    padding: 1rem;
    border: 2px solid var(--light-orange);
    border-radius: 8px;
}

.dimension-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-azure);
}

.dimension-card p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.rating-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.rating-group input[type="radio"] {
    display: none;
}

.rating-group label {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.rating-group input[type="radio"]:checked + label {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
    transform: scale(1.1);
}

.rating-group label:hover {
    border-color: var(--primary-orange);
}

.reflections-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reflection-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reflection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-orange);
}

.reflection-date {
    color: #666;
    font-size: 0.9rem;
}

.reflection-feedback {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-orange);
    border-radius: 4px;
}

.reflection-feedback h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-azure);
}

/* ========================================
   Charts & Visualizations
   ======================================== */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.maturity-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.maturity-dimension {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dimension-label {
    flex: 0 0 180px;
    font-weight: 600;
    color: var(--dark-azure);
    font-size: 0.9rem;
}

.dimension-bar-container {
    flex: 1;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.dimension-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-orange), #ffd700);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    transition: width 0.5s ease;
}

.dimension-score {
    color: var(--dark-azure);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========================================
   Authentication Pages
   ======================================== */
.auth-page {
    background: linear-gradient(135deg, var(--dark-azure) 0%, #2a5270 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    max-width: 450px;
    width: 100%;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .brand-title {
    font-family: 'Holiday', serif;
    font-size: 2.5rem;
    color: var(--primary-dark-azure);
    margin-bottom: 0.5rem;
}

.auth-header .tagline {
    font-family: 'Inter', sans-serif;
    color: #666;
    font-size: 1rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.auth-footer a {
    color: var(--primary-orange);
    text-decoration: none;
}

.form-footer {
    text-align: right;
    margin-bottom: 1rem;
}

.text-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-size: 0.9rem;
}

.text-link:hover {
    text-decoration: underline;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: #333;
}

/* ========================================
   Loading & Empty States
   ======================================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-orange);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark-azure);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-success {
    background: #4caf50;
}

.toast.toast-error {
    background: #f44336;
}

.toast.toast-warning {
    background: #ff9800;
}

/* ========================================
   Responsive Design
   ======================================== */
/* ========================================
   Hamburger button — visible on mobile only
   ======================================== */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.1); }
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.25s ease;
    transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: min(280px, 85vw);
    height: 100vh;
    background: #1d3c58;
    z-index: 2000;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.nav-drawer.open {
    display: flex;
    transform: translateX(0);
}
.nav-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1999;
}
.nav-drawer-overlay.open { display: block; }

.nav-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.nav-drawer-brand {
    font-family: 'Holiday', serif;
    font-size: 1.2rem;
    color: #fdbe38;
    font-weight: 700;
}
.nav-drawer-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s;
}
.nav-drawer-close:hover { background: rgba(255,255,255,0.1); }

.nav-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.nav-drawer-links a,
.nav-drawer-links .nav-drawer-link {
    display: block;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.nav-drawer-links a:hover,
.nav-drawer-links .nav-drawer-link:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-drawer-links a.active { background: #fdbe38; color: #1d3c58; }

.nav-drawer-user {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
.nav-drawer-user strong { color: white; display: block; margin-bottom: 0.5rem; }
.nav-drawer-logout {
    display: block;
    margin-top: 0.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 0.55rem 1rem;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: background 0.15s;
}
.nav-drawer-logout:hover { background: rgba(255,255,255,0.15); color: white; }

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav links */
    .nav-hamburger { display: flex; }
    .nav-menu      { display: none; }
    .user-name     { display: none; }  /* shown in drawer instead */

    /* Nav bar: brand left, hamburger right */
    .lms-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }
    .nav-brand { flex: 1; }
    .nav-actions { gap: 0.4rem; }
    /* Hide the desktop logout button on mobile — drawer has its own */
    .nav-actions #logoutButton { display: none; }

    /* Cards */
    .card-grid        { grid-template-columns: 1fr; gap: 0.85rem; }
    .dimensions-grid  { grid-template-columns: 1fr; }
    .dimension-label  { flex: 0 0 120px; font-size: 0.8rem; }
    .modal-content    { width: 95%; padding: 1.2rem; }
    .modal            { align-items: flex-end; }
    .modal-content    { border-radius: 14px 14px 0 0; max-height: 90vh; }
}

@media (max-width: 380px) {
    .nav-brand h2 { font-size: 1rem; }
}