/* ============================================================
   Examups Master Dashboard — Frontend (Student) Styles
   ============================================================ */

:root {
    --emd-f-primary:  #6366f1;
    --emd-f-green:    #10b981;
    --emd-f-blue:     #3b82f6;
    --emd-f-orange:   #f97316;
    --emd-f-teal:     #14b8a6;
    --emd-f-red:      #ef4444;
    --emd-f-border:   #e5e7eb;
    --emd-f-bg:       #f8fafc;
    --emd-f-text:     #111827;
    --emd-f-muted:    #6b7280;
    --emd-f-radius:   14px;
    --emd-f-shadow:   0 2px 12px rgba(0,0,0,.07);
}

.emd-dashboard { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 960px; margin: 0 auto; }
.emd-dashboard * { box-sizing: border-box; }

/* ---- Login gate ---- */
.emd-login-notice {
    text-align: center;
    padding: 60px 24px;
    background: var(--emd-f-bg);
    border: 1px solid var(--emd-f-border);
    border-radius: var(--emd-f-radius);
}
.emd-login-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.emd-login-notice h3 { color: var(--emd-f-text); margin: 0 0 8px; font-size: 1.4rem; }
.emd-login-notice p  { color: var(--emd-f-muted); margin: 0 0 20px; }

/* ---- User bar ---- */
.emd-user-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--emd-f-radius);
    margin-bottom: 20px;
    color: #fff;
}
.emd-avatar-img { border-radius: 50%; display: block; }
.emd-user-name  { font-size: 1.1rem; font-weight: 700; color: #fff; }
.emd-user-email { font-size: 0.85rem; color: #94a3b8; }

/* ---- Summary chips ---- */
.emd-summary-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.emd-chip {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid var(--emd-f-border);
    border-radius: var(--emd-f-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--emd-f-shadow);
}
.emd-chip-num { display: block; font-size: 2rem; font-weight: 800; color: var(--emd-f-primary); line-height: 1; margin-bottom: 4px; }
.emd-chip-lbl { font-size: 0.78rem; color: var(--emd-f-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Front tabs ---- */
.emd-front-tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--emd-f-border);
    border-radius: var(--emd-f-radius);
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: var(--emd-f-shadow);
    flex-wrap: wrap;
}
.emd-ftab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--emd-f-muted);
    transition: all .2s;
    white-space: nowrap;
}
.emd-ftab:hover  { background: #f1f5f9; color: var(--emd-f-text); }
.emd-ftab.active { background: var(--emd-f-primary); color: #fff; }

.emd-badge-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255,255,255,.25);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: inherit;
}
.emd-ftab.active .emd-badge-num { background: rgba(255,255,255,.25); color: #fff; }
.emd-ftab:not(.active) .emd-badge-num { background: #e0e7ff; color: var(--emd-f-primary); }

/* ---- Tab panels ---- */
.emd-ftab-panel { display: none; }
.emd-ftab-panel.active { display: block; }

/* ---- Empty state ---- */
.emd-empty-state {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border: 1px dashed var(--emd-f-border);
    border-radius: var(--emd-f-radius);
}
.emd-empty-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.emd-empty-state h4 { color: var(--emd-f-text); font-size: 1.2rem; margin: 0 0 8px; }
.emd-empty-state p  { color: var(--emd-f-muted); margin: 0; font-size: 0.9rem; }

/* ---- Content cards grid ---- */
.emd-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.emd-content-card {
    background: #fff;
    border: 1px solid var(--emd-f-border);
    border-radius: var(--emd-f-radius);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: var(--emd-f-shadow);
    transition: transform .2s, box-shadow .2s;
}
.emd-content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
}

.emd-content-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    line-height: 1;
}
.emd-icon-green  { background: #d1fae5; }
.emd-icon-blue   { background: #dbeafe; }
.emd-icon-orange { background: #ffedd5; }
.emd-icon-teal   { background: #ccfbf1; }
.emd-icon-red    { background: #fee2e2; }

.emd-cover-thumb { width: 48px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.emd-content-card-body { flex: 1; min-width: 0; }
.emd-content-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--emd-f-text);
    margin-bottom: 8px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emd-content-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.emd-meta-date  { font-size: 0.78rem; color: var(--emd-f-muted); }
.emd-meta-price { font-size: 0.78rem; font-weight: 600; color: var(--emd-f-green); }

/* Tags */
.emd-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--emd-f-muted);
}
.emd-tag-green  { background: #d1fae5; color: #065f46; }
.emd-tag-blue   { background: #dbeafe; color: #1e40af; }
.emd-tag-orange { background: #ffedd5; color: #9a3412; }
.emd-tag-teal   { background: #ccfbf1; color: #0f766e; }
.emd-tag-red    { background: #fee2e2; color: #991b1b; }

/* Progress bar */
.emd-progress-bar-wrap {
    height: 7px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}
.emd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--emd-f-blue), var(--emd-f-primary));
    border-radius: 999px;
    transition: width .4s;
}
.emd-progress-label { font-size: 0.75rem; color: var(--emd-f-muted); }

/* Subsection title */
.emd-subsection-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--emd-f-text);
    margin: 24px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.emd-count {
    background: #e0e7ff;
    color: var(--emd-f-primary);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Buttons */
.emd-btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: var(--emd-f-primary);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background .2s;
}
.emd-btn-primary:hover { background: #4f46e5; color: #fff; }

.emd-btn-sm {
    display: inline-block;
    padding: 5px 12px;
    background: var(--emd-f-primary);
    color: #fff;
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition: background .2s;
}
.emd-btn-sm:hover { background: #4f46e5; color: #fff; }

/* ---- Results table ---- */
.emd-results-table-wrap {
    background: #fff;
    border: 1px solid var(--emd-f-border);
    border-radius: var(--emd-f-radius);
    overflow: hidden;
    box-shadow: var(--emd-f-shadow);
    overflow-x: auto;
}
.emd-results-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.emd-results-table thead th {
    padding: 14px 16px;
    background: #f8fafc;
    color: var(--emd-f-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    border-bottom: 1px solid var(--emd-f-border);
    font-weight: 600;
}
.emd-results-table tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: var(--emd-f-text);
    border-bottom: 1px solid #f1f5f9;
}
.emd-results-table tbody tr:last-child td { border-bottom: none; }
.emd-results-table tbody tr:hover td { background: #f8fafc; }

.emd-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 0.85rem;
}
.emd-score-pass { background: #d1fae5; color: #065f46; }
.emd-score-fail { background: #fee2e2; color: #991b1b; }
.emd-score-badge small { font-weight: 500; opacity: .8; font-size: 0.78rem; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .emd-user-bar { padding: 16px; }
    .emd-cards-grid { grid-template-columns: 1fr; }
    .emd-front-tabs { gap: 3px; }
    .emd-ftab { padding: 8px 12px; font-size: 0.82rem; }
}
