/**
 * Eduzentra — Course Finder (Advanced UI)
 * Admin blue theme + student panel overrides
 */

:root {
    --ez-cf-primary: #2563eb;
    --ez-cf-primary-dark: #1d4ed8;
    --ez-cf-primary-deep: #0f52ba;
    --ez-cf-bg: #F5F7FB;
    --ez-cf-muted: #64748b;
}

.ez-cf-page {
    padding: 0 0 2rem;
    background: var(--ez-cf-bg);
    min-height: 60vh;
}

.ez-cf-page .ez-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.ez-cf-page .ez-btn--primary,
.ez-cf-page .ez-btn--emerald {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.ez-cf-page .ez-btn--primary:hover,
.ez-cf-page .ez-btn--emerald:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    transform: translateY(-1px);
}

.ez-cf-hero {
    background: linear-gradient(135deg, var(--ez-emerald-dark) 0%, var(--ez-emerald) 100%);
    padding: clamp(2.5rem, 5vw, 3.5rem) 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.ez-cf-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0);
    background-size: 28px 28px;
}

.ez-cf-hero__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.ez-cf-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--ez-gold-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.ez-cf-hero__title {
    font-family: var(--ez-serif, Georgia, serif);
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.ez-cf-hero__text {
    color: rgba(255,255,255,0.82);
    font-size: 1rem;
    margin: 0;
}

.ez-cf-search {
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 16px 40px rgba(15,23,42,0.08);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.ez-cf-search__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ez-muted, #5c6b65);
    margin-bottom: 0.4rem;
    display: block;
}

.ez-cf-search .form-control,
.ez-cf-search .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9375rem;
    min-height: 44px;
    box-shadow: none !important;
}

.ez-cf-search .form-control:focus,
.ez-cf-search .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.ez-cf-search__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.ez-cf-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.ez-cf-sidebar {
    position: sticky;
    top: 90px;
}

.ez-cf-panel {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
    overflow: hidden;
}

.ez-cf-panel__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fafbfd, #fff);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ez-cf-panel__title {
    margin: 0;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ez-cf-panel__title i {
    color: var(--ez-cf-primary);
    font-size: 1rem;
}

.ez-cf-panel__body {
    padding: 1.15rem 1.25rem 1.25rem;
}

.ez-cf-filter-group {
    margin-bottom: 1rem;
}

.ez-cf-filter-group:last-child {
    margin-bottom: 0;
}

.ez-cf-filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.35rem;
    display: block;
}

.ez-cf-filter-group .form-control,
.ez-cf-filter-group .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    box-shadow: none !important;
}

.ez-cf-divider {
    height: 1px;
    background: #eef2f7;
    margin: 1rem 0;
}

.ez-cf-advanced-toggle {
    width: 100%;
    border: none;
    background: #eff6ff;
    color: var(--ez-cf-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.ez-cf-advanced-toggle:hover {
    background: #dbeafe;
}

.ez-cf-advanced {
    display: none;
    padding-top: 0.5rem;
}

.ez-cf-advanced.is-open {
    display: block;
}

.ez-cf-results {
    min-width: 0;
}

.ez-cf-results__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ez-cf-results__count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.ez-cf-results__count span {
    color: var(--ez-cf-primary);
}

.ez-cf-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: #fff;
    border-radius: 18px;
    border: 1px dashed #cbd5e1;
}

.ez-cf-empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--ez-cf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.ez-cf-empty__title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.ez-cf-empty__text {
    color: var(--ez-cf-muted);
    font-size: 0.875rem;
    margin: 0;
}

.ez-cf-empty h3 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.ez-cf-empty p {
    color: var(--ez-cf-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Results table wrapper */
.ez-cf-results .table-responsive {
    overflow: visible !important;
}

#course_list {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 12px;
}

#course_list thead {
    display: none;
}

#course_list tbody tr {
    background: transparent !important;
}

#course_list tbody td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    vertical-align: top;
}

#course_list_wrapper {
    margin-top: 0 !important;
}

#result_table {
    margin-top: 0 !important;
    display: block;
    width: 100% !important;
}

.dataTables_info,
.dataTables_paginate {
    padding: 1rem 0 0 !important;
}

.dataTables_paginate .paginate_button {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.85rem !important;
    margin: 0 2px;
    background: #fff !important;
    color: #334155 !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--ez-cf-primary) !important;
    border-color: var(--ez-cf-primary) !important;
    color: #fff !important;
}

/* Course card (server-rendered) */
.ez-cf-course-card {
    background: #fff;
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.06);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ez-cf-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15,23,42,0.1);
}

.ez-cf-course-card__head {
    padding: 1.25rem 1.35rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.ez-cf-course-card__title {
    margin: 0 0 0.65rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
}

/* Prevent global style.css clamp() from blowing up card titles */
.ez-cf-page .ez-cf-course-card__title,
.ez-cf-page .ez-cf-course-card h3 {
    font-size: 1.0625rem !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}

.ez-cf-course-card__title a {
    color: var(--ez-cf-primary-deep);
    text-decoration: none;
}

.ez-cf-course-card__title a:hover {
    color: var(--ez-cf-primary);
}

.ez-cf-course-card__uni {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
}

.ez-cf-course-card__uni span,
.ez-cf-course-card__uni a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
}

.ez-cf-course-card__uni a {
    font-weight: 600;
    color: var(--ez-cf-primary-deep);
}

.ez-cf-course-card__uni i {
    color: var(--ez-cf-primary);
    width: 16px;
    text-align: center;
}

.ez-cf-course-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem 1rem;
    padding: 1rem 1.35rem;
}

.ez-cf-course-card__stat-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ez-cf-course-card__stat-label i {
    color: var(--ez-cf-primary);
}

.ez-cf-course-card__stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.ez-cf-course-card__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.35rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.ez-cf-course-card__footer .btn,
.ez-cf-course-card__footer .ez-btn {
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 1.1rem;
}

/* Select2 inside course finder */
.ez-cf-page .select2-container--default .select2-selection--multiple,
.ez-cf-page .select2-container--default .select2-selection--single {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    min-height: 44px !important;
}

.ez-cf-page .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    min-height: 40px !important;
    padding: 4px 8px !important;
}

/* Modal */
#coursePreferenceModal .modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
}

#coursePreferenceModal .modal-header {
    background: linear-gradient(135deg, #0f52ba 0%, #3b82f6 100%);
    color: #fff;
    border: none !important;
}

#coursePreferenceModal .btn-close {
    filter: invert(1);
}

@media (max-width: 991px) {
    .ez-cf-layout {
        grid-template-columns: 1fr;
    }

    .ez-cf-sidebar {
        position: static;
    }

    .ez-cf-search__actions {
        justify-content: stretch;
    }

    .ez-cf-search__actions .ez-btn {
        flex: 1;
    }
}

@media (max-width: 575px) {
    .ez-cf-search {
        padding: 1.15rem;
    }

    .ez-cf-course-card__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── Student panel (logged-in) ─── */
.edudash-student .ec-student-cf-header {
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0f52ba 0%, #3b82f6 60%, #60a5fa 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.edudash-student .ec-student-cf-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.edudash-student .ec-student-cf-header__title {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #fff;
    margin: 0;
}

.edudash-student .ec-student-cf-header__subtitle {
    font-size: 0.8125rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.edudash-student .ec-student-cf-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    font-weight: 600;
}

.edudash-student .ez-cf-page--student {
    padding: 0;
    background: transparent;
}

.edudash-student .ez-cf-search {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.edudash-student .ez-cf-btn-clear {
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-color: #cbd5e1;
    color: #475569;
}

.edudash-student .ez-cf-btn-clear:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
}

.edudash-student .ez-cf-filter-group .form-control,
.edudash-student .ez-cf-filter-group .form-select {
    min-height: 40px;
}

.edudash-student .ez-cf-filter-group .form-control:focus,
.edudash-student .ez-cf-filter-group .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.edudash-student .ez-cf-panel {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.edudash-student .ez-cf-empty {
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
