/* ============================================================
   PREMIUM STUDENT DASHBOARD
   Font: Rubik (inherited) | Accent: #009efb → indigo upgrade
   ============================================================ */

/* ── Page shell ─────────────────────────────────────────── */

/* Remove ALL padding/margin from the content wrapper */
.page-wrapper > .content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Kill all the legacy Bootstrap wrappers on the lesson viewer page */
.page-wrapper > .content > .row,
.page-wrapper > .content > .row > .col-sm-12 {
    margin: 0 !important;
    padding: 0 !important;
}

/* Strip card-box chrome on lesson viewer */
.page-wrapper > .content .card-box {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* Strip mailview wrappers */
.mailview-content,
.mailview-header,
.mailview-inner,
.mailview-header .row,
.mailview-header .col-sm-9,
.text-ellipsis,
.text-ellipsis.m-b-10,
.mail-view-title {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    border: none !important;
    display: block !important;
    overflow: visible !important;
}

/* On mobile, also kill the side padding so content goes edge-to-edge */
@media (max-width: 768px) {
    .page-wrapper > .content {
        padding: 0 !important;
    }
}

.main-content-container {
    width: 100%;
    background: #f0f2f8;
}

.modern-container {
    padding: 20px 24px;
}

/* Kill the default card-box chrome so we control everything */
.card-box {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

/* ── Welcome bar ─────────────────────────────────────────── */
.dash-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    margin-bottom: 18px;
    background: linear-gradient(120deg, #1a1f3c 0%, #2d3561 100%);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(26, 31, 60, 0.25);
}

.dash-welcome-text h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.2px;
}

.dash-welcome-text p {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}

.dash-welcome-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.dash-welcome-meta i {
    color: #7eb3ff;
}

/* ── Payment alert ───────────────────────────────────────── */
.payment-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 18px;
}

.payment-alert h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 7px;
}

.payment-icon {
    font-size: 14px;
    color: #f59e0b;
}

.payment-alert p {
    margin: 0;
    font-size: 13px;
    color: #78350f;
}

.click-here {
    color: #b45309;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.click-here:hover { color: #92400e; }

/* ── Stat cards ──────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 18px 20px 16px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* Decorative circle watermark */
.stat-item::after {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    pointer-events: none;
}

.stat-item::before {
    content: '';
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    pointer-events: none;
}

.stat-item.success  { background: linear-gradient(135deg, #059669, #10b981); }
.stat-item.warning  { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-item.secondary{ background: linear-gradient(135deg, #475569, #64748b); }
.stat-item.info     { background: linear-gradient(135deg, #0369a1, #0ea5e9); }

.stat-icon-box { display: none; }

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

/* ── Search / filter bar ─────────────────────────────────── */
.search-section { margin-bottom: 18px; }

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.search-input::placeholder { color: #94a3b8; }

.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.clear-search {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 4px;
    line-height: 1;
}

.clear-search.show { opacity: 1; }
.clear-search:hover { color: #ef4444; }

.search-filters { display: flex; gap: 10px; }

.filter-select {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
    min-width: 160px;
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── Course grid ─────────────────────────────────────────── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.course-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #e8edf5;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.11);
}

/* Coloured top stripe */
.course-card::before {
    content: '';
    display: block;
    height: 4px;
    width: 100%;
}

.course-card.paid::before    { background: linear-gradient(90deg, #059669, #10b981); }
.course-card.pending::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.course-card.blocked::before { background: linear-gradient(90deg, #0369a1, #0ea5e9); }
.course-card.unpaid::before  { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

.course-card-body {
    padding: 18px 20px 14px;
    flex: 1;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.course-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.course-id {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.course-price {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.status-badge.success  { background: #dcfce7; color: #166534; }
.status-badge.warning  { background: #fef9c3; color: #854d0e; }
.status-badge.info     { background: #dbeafe; color: #1e40af; }
.status-badge.secondary{ background: #f1f5f9; color: #475569; }

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-clean {
    flex: 1;
    min-width: 100px;
    padding: 9px 14px;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.18s ease, transform 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.btn-clean:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.btn-clean:active { transform: translateY(0); filter: brightness(0.96); }

.btn-clean.success  { background: #059669; color: #fff; }
.btn-clean.warning  { background: #f59e0b; color: #fff; }
.btn-clean.info     { background: #0ea5e9; color: #fff; }
.btn-clean.primary  { background: #6366f1; color: #fff; }
.btn-clean.secondary{ background: #64748b; color: #fff; }

.course-card-footer {
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* ── No results ──────────────────────────────────────────── */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}

.no-results i    { font-size: 44px; margin-bottom: 14px; opacity: 0.3; display: block; }
.no-results h5   { font-size: 17px; color: #64748b; margin-bottom: 6px; }
.no-results p    { font-size: 13px; margin: 0; }

/* ── Collapsible section headers ─────────────────────────── */
.section-header {
    background: #fff;
    border-radius: 12px;
    padding: 13px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e8edf5;
    transition: box-shadow 0.2s;
}

.section-header:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.09); }

.section-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #94a3b8;
}

.collapsible-section {
    overflow: hidden;
    transition: max-height 0.35s ease;
    margin-bottom: 14px;
}

/* ── Tables ──────────────────────────────────────────────── */
.orders-table {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e8edf5;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-search {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.table-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 30px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    transition: border-color 0.2s;
}

.table-search input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.table-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.table-per-page select {
    padding: 6px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.compact-table { overflow-x: auto; margin-bottom: 14px; }

.compact-table table {
    width: 100%;
    border-collapse: collapse;
}

.compact-table thead { background: #f8fafc; }

.compact-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #e8edf5;
    white-space: nowrap;
}

.compact-table td {
    padding: 11px 14px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.compact-table tbody tr { transition: background 0.15s; }
.compact-table tbody tr:hover { background: #f8fafc; }

.pagination-info { font-size: 12px; color: #64748b; }

.table-pagination { display: flex; gap: 4px; }

.pagination-btn {
    padding: 6px 11px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.pagination-btn.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.pagination-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Utility ─────────────────────────────────────────────── */
.text-success  { color: #059669 !important; }
.text-warning  { color: #d97706 !important; }
.text-danger   { color: #dc2626 !important; }
.text-info     { color: #0ea5e9 !important; }
.text-muted    { color: #94a3b8 !important; }
.fw-bold       { font-weight: 700 !important; }
.d-inline-block{ display: inline-block !important; }
.d-flex        { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center      { align-items: center !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.me-2 { margin-right: .5rem !important; }
.mr-1 { margin-right: .25rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.text-center { text-align: center !important; }
.fa-2x { font-size: 2em !important; }

/* ── Animations ──────────────────────────────────────────── */
.animate-in {
    animation: slideUp 0.35s ease both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger stat cards */
.stats-row .stat-item:nth-child(1) { animation-delay: 0.05s; }
.stats-row .stat-item:nth-child(2) { animation-delay: 0.10s; }
.stats-row .stat-item:nth-child(3) { animation-delay: 0.15s; }
.stats-row .stat-item:nth-child(4) { animation-delay: 0.20s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .modern-container { padding: 10px 10px; }

    .dash-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        border-radius: 10px;
    }

    /* 2 stat cards per row on mobile */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-item { padding: 14px 14px 12px; }
    .stat-number { font-size: 28px; }
    .stat-label { font-size: 10px; }

    .courses-grid { grid-template-columns: 1fr; }

    .search-container { flex-direction: column; gap: 8px; }
    .search-box { min-width: 100%; }
    .filter-select { width: 100%; }

    .table-controls { flex-direction: column; align-items: stretch; }

    .payment-alert { flex-direction: column; gap: 4px; }

    .course-card-body { padding: 14px 14px 10px; }
    .course-card-footer { padding: 8px 14px; }
}

@media (max-width: 480px) {
    .modern-container { padding: 8px 8px; }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-number { font-size: 26px; }

    .dash-welcome-text h2 { font-size: 16px; }
    .dash-welcome-meta { font-size: 11px; }
}

/* ============================================================
   COMPETENCY TEST PAGE
   ============================================================ */

/* Page wrapper */
.mailview-content {
    padding: 0 !important;
}

/* Page title */
.mailview-content h3:first-child {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 16px 0;
}

/* Attempt / retake notice */
.mailview-content > h2,
.mailview-content > h3 {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-left: 4px solid #6366f1;
    border-radius: 0 8px 8px 0;
    padding: 10px 16px;
    margin-bottom: 20px;
}

/* ── Quiz card ───────────────────────────────────────────── */
.mailview-content form {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e8edf5;
    overflow: hidden;
    margin-bottom: 16px;
}

.mailview-content form table {
    width: 100%;
    border-collapse: collapse;
}

/* Question row — dark navy header */
.mailview-content form table tr:first-child td {
    padding: 24px 24px 20px;
    background: linear-gradient(120deg, #1a1f3c 0%, #2d3561 100%);
}

.mailview-content form table tr:first-child h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
}

/* Answer option label — full-row clickable */
.answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    cursor: pointer;
    width: 100%;
    margin: 0;
    font-weight: normal;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.answer-option:hover {
    background: #f8fafc;
}

/* Keep native radio visible and styled */
.answer-option input[type="radio"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #6366f1;
    margin: 0;
}

.answer-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
}

/* Highlight selected row */
.answer-option:has(input:checked) {
    background: #eef2ff;
}

.answer-option:has(input:checked) .answer-text {
    color: #4338ca;
    font-weight: 600;
}

/* ── Action row (buttons) ────────────────────────────────── */
.mailview-content form table tr:last-child td {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e8edf5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mailview-content form table tr:last-child hr {
    display: none;
}

/* Go Back button */
.mailview-content form table tr:last-child button {
    padding: 10px 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}

.mailview-content form table tr:last-child button:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

/* Next/Submit button */
.mailview-content form table tr:last-child input[type="submit"] {
    padding: 10px 24px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.3px;
    transition: filter 0.18s, transform 0.18s;
    box-shadow: 0 3px 10px rgba(99,102,241,0.3);
}

.mailview-content form table tr:last-child input[type="submit"]:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ── Questions remaining badge ───────────────────────────── */
.questions-remaining {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.questions-remaining i {
    color: #6366f1;
}

.questions-remaining strong {
    color: #1e293b;
}

/* ── Alert overrides for this page ──────────────────────── */
.mailview-content .alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 16px;
    font-size: 14px;
}

.mailview-content .alert-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

.mailview-content .alert-danger {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .mailview-content form table tr:first-child td {
        padding: 18px 16px 14px;
    }

    .mailview-content form table tr:first-child h3 {
        font-size: 15px;
    }

    .mailview-content form table tr:has(input[type="radio"]) td {
        padding: 12px 16px;
        font-size: 13px;
    }

    .mailview-content form table tr:last-child td {
        padding: 14px 16px;
        flex-wrap: wrap;
    }
}

/* ============================================================
   SUBJECT LESSONS PAGE
   ============================================================ */

/* Page header strip */
.lessons-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    background: linear-gradient(120deg, #1a1f3c 0%, #2d3561 100%);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.lessons-header i {
    font-size: 18px;
    color: #7eb3ff;
}

.lessons-header strong {
    color: #a5f3fc;
}

/* Override DataTables wrapper to match dashboard style */
.dataTables_wrapper {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8edf5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 16px 20px 20px;
}

/* Top controls row */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 14px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: #fff;
}

/* Table itself */
table#zero_config {
    border: none !important;
    border-collapse: collapse;
    width: 100% !important;
}

table#zero_config thead tr {
    background: #f1f5f9;
}

table#zero_config thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b !important;
    padding: 12px 16px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
    white-space: nowrap;
}

/* DataTables sort icons */
table#zero_config thead th.sorting::after,
table#zero_config thead th.sorting_asc::after,
table#zero_config thead th.sorting_desc::after {
    opacity: 0.4;
}

table#zero_config tbody tr {
    transition: background 0.15s;
}

table#zero_config tbody tr:hover {
    background: #f8fafc !important;
}

table#zero_config tbody td {
    font-size: 13px !important;
    color: #334155 !important;
    padding: 13px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    vertical-align: middle !important;
}

table#zero_config tbody td strong {
    font-weight: 600;
    color: #1e293b;
}

/* Striped rows override */
table#zero_config.table-striped tbody tr:nth-of-type(odd) {
    background: #fafbfc;
}

/* View / Start Lesson button */
.btn-view-lesson {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff !important;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: 0.3px;
    transition: filter 0.18s, transform 0.18s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    white-space: nowrap;
}

.btn-view-lesson:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-view-lesson i {
    font-size: 13px;
}

/* Bottom info + pagination row */
.dataTables_wrapper .dataTables_info {
    font-size: 12px;
    color: #94a3b8;
    padding-top: 14px;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 11px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #fff !important;
    margin: 0 2px !important;
    transition: all 0.18s !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #eef2ff !important;
    border-color: #6366f1 !important;
    color: #6366f1 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .lessons-header { font-size: 13px; padding: 12px 14px; }

    .dataTables_wrapper { padding: 12px 12px 16px; }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
    }

    table#zero_config thead th,
    table#zero_config tbody td {
        padding: 10px 12px !important;
    }

    .btn-view-lesson { padding: 6px 12px; font-size: 11px; }
}

/* ============================================================
   LESSON VIEWER PAGE (upload_lesson.php)
   ============================================================ */

/* Lesson metadata bar */
.lesson-meta-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(120deg, #1a1f3c 0%, #2d3561 100%);
    border-radius: 12px;
    margin: 8px 8px 0 8px;
    color: #fff;
    font-size: 13px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.lesson-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.lesson-meta-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.lesson-meta-bar i {
    color: #7eb3ff;
    font-size: 14px;
}

.lesson-meta-bar strong {
    font-weight: 600;
}

/* Rate Instructor button inside meta bar */
.lesson-meta-bar .btn-rate-instructor {
    flex-shrink: 0;
    padding: 7px 16px;
    font-size: 12px;
    margin: 0;
}

/* Top actions wrapper no longer needed but kept for safety */
.lesson-actions-top {
    display: none;
}

.btn-rate-instructor {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: #fff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: 0.2px;
    border: none;
    cursor: pointer;
    transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-rate-instructor:hover {
    background: linear-gradient(135deg, #4f46e5, #0891b2);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-rate-instructor i {
    font-size: 13px;
}

/* Mobile landscape hint */
.alert-landscape {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    margin: 12px 8px 0 8px;
    font-size: 13px;
    color: #1e40af;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.alert-landscape i {
    font-size: 18px;
    color: #3b82f6;
}

/* Lesson viewer iframe wrapper */
.lesson-viewer-wrap {
    position: relative;
    width: calc(100% - 16px);
    height: 600px;
    margin: 12px 8px 12px 8px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background: #1e1e2e;
}

/* iframe fills wrapper fully — fully interactive */
.lesson-viewer-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: all;
}

/* Hide the open-in-new-tab button — top-right corner overlay */
.lesson-viewer-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 52px;
    background: #1e1e2e;
    border-radius: 0 12px 0 0;
    z-index: 2;
    pointer-events: all;
    cursor: default;
}

/* Visible scroll hint strip on the left edge */
.lesson-viewer-scroll-hint {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 80px;
    background: rgba(99,102,241,0.7);
    border-radius: 0 4px 4px 0;
    z-index: 3;
    pointer-events: none;
    box-shadow: 2px 0 8px rgba(99,102,241,0.4);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* Scroll tip below viewer */
.lesson-scroll-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 8px 12px 8px;
    padding: 10px 16px;
    background: #eef2ff;
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    font-size: 13px;
    color: #3730a3;
}

.lesson-scroll-tip i {
    color: #6366f1;
    font-size: 15px;
    flex-shrink: 0;
}
/* Bottom actions (Take Exam) */
.lesson-actions-bottom {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.btn-take-exam {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff !important;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: filter 0.18s, transform 0.18s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-take-exam:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    color: #fff !important;
}

.btn-take-exam i {
    font-size: 16px;
}

/* ── Full Google Drive Viewer ────────────────────────────── */
.drive-full-viewer {
    position: relative;
    width: calc(100% - 16px);
    height: 85vh;
    min-height: 600px;
    margin: 12px 8px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.drive-full-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: all;
}

/* Hide the "open in new tab" button — top-right corner overlay */
.drive-full-viewer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 56px;
    background: #000;
    border-radius: 0 12px 0 0;
    z-index: 10;
    pointer-events: all;
    cursor: default;
}

@media (max-width: 768px) {
    .drive-full-viewer {
        width: calc(100% - 12px);
        margin: 8px 6px;
        height: 75vh;
        min-height: 450px;
    }
}

@media (max-width: 480px) {
    .drive-full-viewer {
        height: 70vh;
        min-height: 380px;
    }
}

/* ── PDF.js Viewer ───────────────────────────────────────── */
.pdfjs-viewer-wrap {
    width: calc(100% - 16px);
    margin: 12px 8px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background: #2d2d2d;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.pdfjs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(120deg, #1a1f3c 0%, #2d3561 100%);
    color: #fff;
}

.pdfjs-toolbar-left,
.pdfjs-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdfjs-page-info {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    min-width: 100px;
    text-align: center;
}

.pdfjs-zoom-label {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    min-width: 44px;
    text-align: center;
}

.pdfjs-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, transform 0.18s;
}

.pdfjs-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: scale(1.08);
}

.pdfjs-btn:active {
    transform: scale(0.95);
}

.pdfjs-btn-highlight {
    width: auto;
    padding: 0 14px;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,224,102,0.15);
    border-color: rgba(255,224,102,0.4);
    color: #ffe066;
}

.pdfjs-btn-highlight.active {
    background: #ffe066;
    color: #1a1f3c;
    border-color: #ffe066;
    box-shadow: 0 0 10px rgba(255,224,102,0.5);
}

/* Canvas container — this scrolls within the viewer */
.pdfjs-canvas-container {
    overflow-y: auto;
    overflow-x: auto;
    height: 620px;
    background: #525659;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar — visible and styled */
.pdfjs-canvas-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.pdfjs-canvas-container::-webkit-scrollbar-track {
    background: #3a3a3a;
}

.pdfjs-canvas-container::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 6px;
    border: 2px solid #3a3a3a;
}

.pdfjs-canvas-container::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

/* The rendered PDF canvas */
#pdfCanvas {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-radius: 2px;
    max-width: 100%;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}

/* Loading indicator */
.pdfjs-loading {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    padding: 60px 20px;
    text-align: center;
}

.pdfjs-loading i {
    font-size: 28px;
    display: block;
    margin-bottom: 12px;
    color: #6366f1;
}

/* Highlight marks */
mark {
    background: #ffe066 !important;
    color: inherit !important;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pdfjs-viewer-wrap {
        width: calc(100% - 12px);
        margin: 8px 6px;
    }

    .pdfjs-canvas-container {
        height: 460px;
    }

    .pdfjs-toolbar {
        padding: 8px 12px;
        gap: 6px;
    }

    .pdfjs-btn-highlight span {
        display: none;
    }

    .pdfjs-zoom-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .pdfjs-canvas-container {
        height: 380px;
    }
}

/* ── Mobile responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .lesson-meta-bar {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 12px;
    }

    .lesson-meta-info {
        gap: 10px;
    }

    .lesson-meta-bar .btn-rate-instructor {
        width: 100%;
        justify-content: center;
    }

    .lesson-viewer-wrap {
        width: calc(100% - 16px);
        margin: 8px 8px 8px 8px;
        height: 450px;
    }

    .lesson-viewer-wrap iframe {
        width: 100%;
        height: 100%;
    }

    .btn-rate-instructor,
    .btn-take-exam {
        width: 100%;
        justify-content: center;
    }

    .lesson-actions-top {
        justify-content: stretch;
    }
}

@media (max-width: 480px) {
    .lesson-viewer-wrap {
        width: calc(100% - 12px);
        margin: 6px 6px 6px 6px;
        height: 380px;
    }

    .lesson-viewer-wrap iframe {
        width: 100%;
        height: 100%;
    }

    .lesson-viewer-wrap::after {
        width: 44px;
        height: 44px;
    }

    .btn-take-exam {
        padding: 12px 24px;
        font-size: 14px;
    }
}
