/* =========================================
   SYLLABUS.CSS
   Dedicated styles for the Syllabus Page.
   Uses global.css design tokens.
   ========================================= */


/* ─── PAGE HEADER ────────────────────────── */
.syllabus-hero {
    background: var(--gradient-brand);
    padding: 60px 0 50px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.syllabus-hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    top: -260px;
    right: -120px;
    pointer-events: none;
}

.syllabus-hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    bottom: -160px;
    left: -80px;
    pointer-events: none;
}

.syllabus-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.syllabus-hero-text h1 {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.syllabus-hero-text p {
    color: rgba(255, 255, 255, .82);
    font-size: var(--font-body);
    line-height: var(--line-body);
    margin: 0;
}

.syllabus-hero-icon {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.syllabus-hero-icon i {
    font-size: 40px;
    color: #fff;
}

/* Breadcrumb */
.syllabus-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.syllabus-breadcrumb a,
.syllabus-breadcrumb span {
    font-size: var(--font-small);
    font-weight: 600;
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    transition: color .3s;
}

.syllabus-breadcrumb a:hover { color: #fff; }

.syllabus-breadcrumb .sep {
    color: rgba(255, 255, 255, .4);
    font-size: 11px;
}

.syllabus-breadcrumb .current { color: #fff; }


/* ─── FILTER CARD ────────────────────────── */
.filter-card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 36px 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(0, 0, 0, .05);
}

.filter-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f0f4ff;
}

.filter-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(10,61,145,.1), rgba(18,199,234,.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-card-icon i {
    font-size: 20px;
    color: var(--primary);
}

.filter-card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    line-height: 1.2;
}

.filter-card-header p {
    font-size: var(--font-small);
    color: var(--text);
    margin: 3px 0 0;
}

/* Filter Grid */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: .02em;
}

.filter-field label .req {
    color: #e53e3e;
    margin-left: 2px;
}

.filter-select,
.filter-input {
    width: 100%;
    height: 52px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-btn);
    padding: 0 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--dark);
    background: #fafbff;
    outline: none;
    transition: border-color .3s, box-shadow .3s, background .3s;
    appearance: none;
    -webkit-appearance: none;
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230a3d91' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 61, 145, .08);
}

.filter-select:disabled {
    opacity: .55;
    cursor: not-allowed;
    background-color: #f0f4f8;
}

/* Filter Buttons */
.filter-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-search {
    height: 52px;
    padding: 0 28px;
    border-radius: var(--radius-btn);
    background: var(--gradient-brand);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .35s ease;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(10, 61, 145, .3);
}

.btn-reset {
    height: 52px;
    width: 52px;
    border-radius: var(--radius-btn);
    background: #f3f7fc;
    color: var(--text);
    font-size: 16px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .3s ease;
    flex-shrink: 0;
}

.btn-reset:hover {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark);
    transform: rotate(180deg);
}


/* ─── ACTIVE FILTERS BAR ─────────────────── */
.active-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.active-filters-label {
    font-size: var(--font-small);
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-badge);
    background: linear-gradient(135deg, rgba(10,61,145,.08), rgba(18,199,234,.08));
    border: 1px solid rgba(10, 61, 145, .15);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.filter-badge i { font-size: 11px; opacity: .7; }


/* ─── RESULTS CARD ───────────────────────── */
.results-card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .05);
}

.results-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    border-bottom: 1px solid #f0f4ff;
    background: #fafbff;
    gap: 16px;
    flex-wrap: wrap;
}

.results-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}

.results-card-title i {
    font-size: 20px;
    color: #e53e3e;
}

.results-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: var(--radius-badge);
    background: var(--gradient-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}


/* ─── SYLLABUS TABLE ─────────────────────── */
.syllabus-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.syllabus-table {
    width: 100%;
    border-collapse: collapse;
}

.syllabus-table thead th {
    background: #f8faff;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 14px 20px;
    border-bottom: 1px solid #eef2ff;
    white-space: nowrap;
}

.syllabus-table thead th:first-child { width: 70px; }
.syllabus-table thead th:last-child  { width: 120px; text-align: center; }

.syllabus-table tbody tr {
    transition: background .2s;
}

.syllabus-table tbody tr:hover {
    background: #f8faff;
}

.syllabus-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f7ff;
    vertical-align: middle;
    font-size: 14px;
    color: var(--dark);
}

.syllabus-table tbody tr:last-child td {
    border-bottom: none;
}

.row-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    background: #f3f7fc;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.class-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdf-icon-wrap i {
    font-size: 17px;
    color: #e53e3e;
}

.class-name-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
}

/* Action Buttons */
.action-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-decoration: none;
    transition: all .25s ease;
    flex-shrink: 0;
}

.btn-icon-download {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.btn-icon-download:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(10, 61, 145, .25);
}

.btn-icon-email {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.btn-icon-email:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(22, 163, 74, .25);
}


/* ─── EMPTY STATE ────────────────────────── */
.syllabus-empty {
    padding: 64px 24px;
    text-align: center;
}

.syllabus-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f3f7fc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.syllabus-empty-icon i {
    font-size: 34px;
    color: #c0ccdf;
}

.syllabus-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.syllabus-empty p {
    font-size: 14px;
    color: var(--text);
    margin: 0;
}


/* ─── INITIAL STATE ──────────────────────── */
.syllabus-initial {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 80px 24px;
    text-align: center;
    border: 2px dashed #d8e4f8;
}

.syllabus-initial-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(10,61,145,.08), rgba(18,199,234,.08));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.syllabus-initial-icon i {
    font-size: 38px;
    color: var(--primary);
    opacity: .6;
}

.syllabus-initial h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.syllabus-initial p {
    font-size: var(--font-body);
    color: var(--text);
    max-width: 380px;
    margin: 0 auto;
    line-height: var(--line-body);
}


/* ─── EMAIL MODAL ────────────────────────── */
.syllabus-modal .modal-content {
    border-radius: 24px;
    border: none;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.syllabus-modal .modal-header {
    background: var(--gradient-brand);
    padding: 24px 28px;
    border: none;
}

.syllabus-modal .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.syllabus-modal .modal-title i { font-size: 20px; }

.syllabus-modal .btn-close {
    filter: brightness(0) invert(1);
    opacity: .7;
}

.syllabus-modal .btn-close:hover { opacity: 1; }

.syllabus-modal .modal-body {
    padding: 28px;
}

.syllabus-modal .modal-footer {
    padding: 18px 28px;
    border-top: 1px solid #f0f4ff;
    background: #fafbff;
}

/* Modal file info badge */
.modal-file-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    margin-bottom: 24px;
}

.modal-file-badge i {
    font-size: 22px;
    color: #e53e3e;
    flex-shrink: 0;
}

.modal-file-badge span {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
}

/* Modal Form Fields */
.modal-field {
    margin-bottom: 18px;
}

.modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.modal-field label .req { color: #e53e3e; margin-left: 2px; }

.modal-input {
    width: 100%;
    height: 50px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-btn);
    padding: 0 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--dark);
    background: #fafbff;
    outline: none;
    transition: border-color .3s, box-shadow .3s;
}

.modal-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 61, 145, .08);
}

.modal-input.is-invalid { border-color: #e53e3e; }

.field-error {
    font-size: 12px;
    color: #e53e3e;
    margin-top: 5px;
    display: none;
}

.field-error.visible { display: block; }

/* Modal Alert */
.modal-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    align-items: center;
    gap: 8px;
}

.modal-alert.visible { display: flex; }

.modal-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.modal-alert.danger {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

/* Modal Buttons */
.btn-modal-cancel {
    height: 48px;
    padding: 0 22px;
    border-radius: var(--radius-btn);
    background: #f3f7fc;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .3s;
}

.btn-modal-cancel:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.btn-modal-send {
    height: 48px;
    padding: 0 28px;
    border-radius: var(--radius-btn);
    background: var(--gradient-brand);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .35s;
}

.btn-modal-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(10, 61, 145, .3);
}

.btn-modal-send:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ─── RESPONSIVE ─────────────────────────── */

/* TABLET */
@media (max-width: 992px) {
    .syllabus-hero { padding: 50px 0 40px; margin-bottom: 40px; }

    .filter-card { padding: 28px 24px; }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .filter-btn-group { width: 100%; }
    .btn-search { flex: 1; justify-content: center; }
}

/* MOBILE */
@media (max-width: 768px) {
    .syllabus-hero { padding: 40px 0 32px; margin-bottom: 30px; }

    .syllabus-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .syllabus-hero-icon { display: none; }

    .syllabus-hero-text h1 { font-size: 28px; letter-spacing: -.5px; }

    .filter-card { padding: 22px 18px; border-radius: 20px; }

    .filter-card-header { margin-bottom: 22px; padding-bottom: 16px; }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .filter-select,
    .filter-input { height: 48px; font-size: 14px; }

    .btn-search { height: 48px; font-size: 14px; }

    .btn-reset { height: 48px; width: 48px; }

    .results-card { border-radius: 20px; }

    .results-card-header { padding: 16px 18px; }

    .syllabus-table thead th,
    .syllabus-table tbody td { padding: 12px 14px; }

    .class-name-text { font-size: 13px; }

    .syllabus-initial { padding: 50px 20px; border-radius: 20px; }

    .syllabus-modal .modal-content { border-radius: 20px; }

    .syllabus-modal .modal-body { padding: 20px; }

    .syllabus-modal .modal-footer { padding: 14px 20px; }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    .syllabus-hero-text h1 { font-size: 24px; }

    .filter-card { padding: 18px 14px; }

    .active-filters-bar { gap: 8px; }

    .results-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .syllabus-table thead th:nth-child(2),
    .syllabus-table tbody td:nth-child(2) {
        min-width: 200px;
    }

    .btn-modal-cancel,
    .btn-modal-send { height: 44px; font-size: 13px; padding: 0 18px; }
}

/* ─── CUSTOM MODAL (no Bootstrap) ───────── */
.syl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.syl-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.syl-modal-box {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .18);
    overflow: hidden;
    width: 100%;
    max-width: 480px;
    transform: translateY(24px) scale(0.97);
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

.syl-modal-overlay.is-open .syl-modal-box {
    transform: translateY(0) scale(1);
}

.syl-modal-header {
    background: var(--gradient-brand);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.syl-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.syl-modal-title i { font-size: 20px; }

.syl-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    transition: background .2s;
}

.syl-modal-close:hover { background: rgba(255, 255, 255, .32); }

.syl-modal-body { padding: 26px; }

.syl-modal-footer {
    padding: 16px 26px;
    border-top: 1px solid #f0f4ff;
    background: #fafbff;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 520px) {
    .syl-modal-box { border-radius: 18px; }
    .syl-modal-body { padding: 18px; }
    .syl-modal-footer { padding: 14px 18px; }
}