/* =============================================
   Makers' Muse LMS — Frontend Styles
   ============================================= */

:root {
    --mml-primary:    #5c6bc0;
    --mml-admin:      #7c4dff;
    --mml-coord:      #bf8c30;
    --mml-teacher:    #00897b;
    --mml-student:    #1976d2;
    --mml-parent:     #558b2f;
    --mml-bg:         #f5f6fa;
    --mml-card:       #ffffff;
    --mml-border:     #e2e5f0;
    --mml-text:       #2d3142;
    --mml-muted:      #7a7f9a;
    --mml-radius:     12px;
    --mml-shadow:     0 2px 16px rgba(92,107,192,0.10);
    --mml-success:    #2e7d32;
    --mml-error:      #c62828;
}

/* Base */
.mml-wrap { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--mml-bg); min-height: 80vh; padding: 0 0 40px; color: var(--mml-text); }

/* ─── LOGIN ─────────────────────────────────── */
.mml-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; padding: 20px; }
.mml-login-card { background: var(--mml-card); border-radius: 20px; box-shadow: 0 8px 40px rgba(92,107,192,0.15); padding: 48px 40px; width: 100%; max-width: 420px; }
.mml-login-logo { text-align: center; margin-bottom: 32px; }
.mml-logo-icon { font-size: 48px; }
.mml-login-title { font-size: 28px; font-weight: 700; color: var(--mml-primary); margin: 8px 0 4px; }
.mml-login-subtitle { color: var(--mml-muted); font-size: 15px; }
.mml-login-roles { text-align: center; margin-top: 24px; color: var(--mml-muted); font-size: 13px; }

/* ─── HEADER ────────────────────────────────── */
.mml-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-radius: 0 0 var(--mml-radius) var(--mml-radius); margin-bottom: 24px; color: white; }
.mml-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.mml-header-left, .mml-header-right { display: flex; align-items: center; gap: 12px; }
.mml-header-admin      { background: linear-gradient(135deg, #5c35c9 0%, #7c4dff 100%); }
.mml-header-coordinator{ background: linear-gradient(135deg, #a06828 0%, #d4a037 100%); }
.mml-header-teacher    { background: linear-gradient(135deg, #006156 0%, #00897b 100%); }
.mml-header-student    { background: linear-gradient(135deg, #1251a3 0%, #1976d2 100%); }
.mml-header-parent     { background: linear-gradient(135deg, #3a6b1c 0%, #558b2f 100%); }
.mml-user-name { font-size: 14px; opacity: 0.9; }

/* Role badges in header */
.mml-role-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,0.25); letter-spacing: 0.5px; text-transform: uppercase; }

/* ─── STATS ROW ─────────────────────────────── */
.mml-stats-row { display: flex; gap: 16px; padding: 0 28px 24px; flex-wrap: wrap; }
.mml-stat { background: var(--mml-card); border-radius: var(--mml-radius); padding: 20px 24px; flex: 1; min-width: 120px; box-shadow: var(--mml-shadow); display: flex; flex-direction: column; align-items: center; }
.mml-num { font-size: 32px; font-weight: 800; color: var(--mml-primary); line-height: 1; }
.mml-lbl { font-size: 12px; color: var(--mml-muted); margin-top: 4px; text-align: center; }

/* ─── TABS ──────────────────────────────────── */
.mml-tabs { display: flex; gap: 4px; padding: 0 28px 0; margin-bottom: 20px; flex-wrap: wrap; }
.mml-tab { background: none; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--mml-muted); transition: all .2s; }
.mml-tab:hover { background: var(--mml-card); color: var(--mml-text); }
.mml-tab.active { background: var(--mml-primary); color: white; box-shadow: 0 2px 8px rgba(92,107,192,.3); }
.mml-tab-panel { display: none; padding: 0 28px; }
.mml-tab-panel.active { display: block; }
.mml-tab-panel h3 { font-size: 18px; margin: 0 0 16px; }

/* ─── FORM ELEMENTS ─────────────────────────── */
.mml-form-card { background: var(--mml-card); border-radius: var(--mml-radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--mml-shadow); }
.mml-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.mml-field { display: flex; flex-direction: column; gap: 6px; }
.mml-field.mml-field-full { grid-column: 1 / -1; }
.mml-field.mml-field-row { flex-direction: row; align-items: center; justify-content: space-between; grid-column: 1 / -1; }
.mml-field label { font-size: 13px; font-weight: 600; color: var(--mml-text); }
.mml-field input[type="text"], .mml-field input[type="email"], .mml-field input[type="password"],
.mml-field input[type="number"], .mml-field input[type="date"], .mml-field input[type="month"],
.mml-field input[type="url"], .mml-field select, .mml-field textarea {
    padding: 10px 14px; border: 1.5px solid var(--mml-border); border-radius: 8px;
    font-size: 14px; outline: none; transition: border .2s; background: #fafbff;
    font-family: inherit; color: var(--mml-text);
}
.mml-field input:focus, .mml-field select:focus, .mml-field textarea:focus { border-color: var(--mml-primary); }
.mml-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* ─── BUTTONS ───────────────────────────────── */
.mml-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; font-family: inherit; }
.mml-btn-primary { background: var(--mml-primary); color: white; box-shadow: 0 2px 8px rgba(92,107,192,.3); }
.mml-btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.mml-btn-sm { padding: 6px 14px; font-size: 13px; }
.mml-btn-xs { padding: 4px 10px; font-size: 12px; }
.mml-btn-block { width: 100%; justify-content: center; margin-top: 4px; }
.mml-logout-btn { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }
.mml-logout-btn:hover { background: rgba(255,255,255,0.35); }

/* ─── LINKS ─────────────────────────────────── */
.mml-link { color: var(--mml-primary); text-decoration: none; font-size: 13px; }
.mml-link:hover { text-decoration: underline; }

/* ─── ALERTS ────────────────────────────────── */
.mml-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.mml-alert-error { background: #ffebee; color: var(--mml-error); border: 1px solid #ef9a9a; }
.mml-alert-success { background: #e8f5e9; color: var(--mml-success); border: 1px solid #a5d6a7; }
.mml-msg { margin-top: 12px; min-height: 20px; }
.mml-success { color: var(--mml-success); font-weight: 600; }
.mml-hint { color: var(--mml-muted); font-size: 14px; }

/* ─── TABLES ────────────────────────────────── */
.mml-table-wrap { background: var(--mml-card); border-radius: var(--mml-radius); box-shadow: var(--mml-shadow); overflow: hidden; }
.mml-table { width: 100%; border-collapse: collapse; }
.mml-table th { background: #f0f2ff; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--mml-muted); }
.mml-table td { padding: 12px 16px; border-top: 1px solid var(--mml-border); font-size: 14px; }
.mml-table tr:hover td { background: #f9faff; }

/* ─── BADGE PILLS ───────────────────────────── */
.mml-badge-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.mml-pill-green  { background: #e8f5e9; color: #2e7d32; }
.mml-pill-orange { background: #fff3e0; color: #e65100; }
.mml-pill-blue   { background: #e3f2fd; color: #1565c0; }

/* ─── CARDS ─────────────────────────────────── */
.mml-card-list { display: flex; flex-direction: column; gap: 12px; }
.mml-badge-card { background: var(--mml-card); padding: 16px 20px; border-radius: var(--mml-radius); box-shadow: var(--mml-shadow); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Student grid */
.mml-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mml-student-card { background: var(--mml-card); border-radius: var(--mml-radius); padding: 20px; box-shadow: var(--mml-shadow); display: flex; align-items: center; gap: 14px; }
.mml-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--mml-primary); color: white; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mml-student-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.mml-student-info strong { font-size: 15px; }
.mml-student-info span { font-size: 12px; color: var(--mml-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Portfolio grid */
.mml-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.mml-portfolio-item { background: var(--mml-card); border-radius: var(--mml-radius); padding: 20px; box-shadow: var(--mml-shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.mml-port-icon { font-size: 36px; }

/* Badges grid */
.mml-badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 16px; }
.mml-badge-display { background: var(--mml-card); border-radius: var(--mml-radius); padding: 24px 16px; box-shadow: var(--mml-shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.mml-badge-display.pending { opacity: 0.65; }
.mml-badge-icon { font-size: 40px; }
.mml-badge-level { font-size: 12px; color: var(--mml-muted); }

/* Progress card */
.mml-progress-card { background: var(--mml-card); border-radius: var(--mml-radius); padding: 24px; box-shadow: var(--mml-shadow); display: flex; align-items: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.mml-child-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--mml-parent); color: white; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mml-child-details h4 { margin: 0 0 8px; font-size: 18px; }
.mml-progress-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.mml-progress-stats span { font-size: 14px; color: var(--mml-muted); }

/* Panel header */
.mml-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mml-panel-header h3 { margin: 0; font-size: 18px; }

/* Misc */
.mml-loading { color: var(--mml-muted); padding: 24px; text-align: center; }
.mml-list-panel { margin-top: 24px; }
.mml-list-panel h4 { font-size: 15px; margin-bottom: 12px; }
.mml-form-panel { background: var(--mml-card); border: 1.5px solid var(--mml-border); border-radius: var(--mml-radius); padding: 20px; margin: 16px 0; }
.mml-form-panel h4 { margin: 0 0 16px; }
.mml-toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.mml-toggle-wrap input { display: none; }
.mml-toggle { width: 44px; height: 24px; background: #ccc; border-radius: 12px; position: relative; transition: background .2s; }
.mml-toggle::after { content:''; position:absolute; width:18px; height:18px; background:white; border-radius:50%; top:3px; left:3px; transition: transform .2s; }
.mml-toggle-wrap input:checked + .mml-toggle { background: var(--mml-primary); }
.mml-toggle-wrap input:checked + .mml-toggle::after { transform: translateX(20px); }

/* ─── MODAL ─────────────────────────────────── */
.mml-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.mml-modal { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 500px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.mml-modal h3 { margin: 0 0 20px; font-size: 20px; }

/* ─── EMPTY STATE ───────────────────────────── */
.mml-empty { text-align: center; padding: 48px 24px; color: var(--mml-muted); }
.mml-empty-icon { font-size: 48px; margin-bottom: 12px; }
.mml-empty p { font-size: 15px; margin: 0; }

/* Responsive */
@media (max-width: 640px) {
    .mml-header { padding: 16px; flex-wrap: wrap; gap: 12px; }
    .mml-stats-row { padding: 0 16px 20px; }
    .mml-tabs { padding: 0 16px; }
    .mml-tab-panel { padding: 0 16px; }
    .mml-form-grid { grid-template-columns: 1fr; }
    .mml-login-card { padding: 32px 24px; }
}
