/* ==========================================================================
   EducationistGuru - Colleges & Universities Modern Design System
   High-Contrast, WCAG Compliant, Real-time Filters & 6-Cards Pagination
   ========================================================================== */

/* --- Base Wrapper --- */
.eg-dir-wrapper {
    padding: 24px 0 80px;
    background-color: #f8fafc;
    min-height: 85vh;
}

/* --- Hero Intro Banner --- */
.eg-dir-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    padding: 38px 36px;
    margin-bottom: 32px;
    color: #ffffff;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.14);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.eg-dir-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -8%;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.24) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.eg-dir-hero .eg-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 107, 0, 0.16);
    color: #ff7e67;
    border: 1px solid rgba(255, 107, 0, 0.4);
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

.eg-dir-hero .eg-hero-title,
.eg-dir-hero h1.eg-hero-title {
    font-size: clamp(26px, 3.5vw, 36px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    color: #ffffff !important;
}

.eg-dir-hero .eg-hero-title span,
.eg-dir-hero h1.eg-hero-title span {
    color: #ff6b00 !important;
}

.eg-dir-hero .eg-hero-desc,
.eg-dir-hero p.eg-hero-desc {
    color: #e2e8f0 !important;
    font-size: 15.5px;
    max-width: 780px;
    line-height: 1.65;
    margin-bottom: 24px;
}

.eg-dir-hero .eg-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.eg-dir-hero .eg-stat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: #f1f5f9;
    font-weight: 500;
}

.eg-dir-hero .eg-stat-item i {
    color: #ff6b00;
    font-size: 16px;
}

.eg-dir-hero .eg-stat-item strong {
    color: #ffffff;
    font-weight: 700;
}

/* Hero Action CTA Button */
.eg-hero-cta-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #e62208 100%);
    color: #ffffff !important;
    border: none;
    padding: 13px 26px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(255, 107, 0, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

.eg-hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 107, 0, 0.6);
    background: linear-gradient(135deg, #ff7e1d 0%, #ff6b00 100%);
}

/* --- Search & Filter Control Panel --- */
.eg-search-control-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.eg-search-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1fr auto;
    gap: 14px;
    align-items: center;
}

@media (max-width: 1199px) {
    .eg-search-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .eg-search-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.eg-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.eg-search-input-wrap .search-icon {
    position: absolute;
    left: 16px;
    color: #64748b;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.eg-search-input {
    width: 100%;
    height: 48px;
    padding: 10px 42px 10px 44px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14.5px;
    color: #0f172a;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.eg-search-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.eg-search-input:focus {
    background: #ffffff;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3.5px rgba(255, 107, 0, 0.15);
}

.eg-search-input:focus + .search-icon {
    color: #ff6b00;
}

.eg-search-clear {
    position: absolute;
    right: 12px;
    width: 26px;
    height: 26px;
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.eg-search-clear:hover {
    background: #ff6b00;
    color: #ffffff;
}

.eg-filter-select {
    width: 100%;
    height: 48px;
    padding: 10px 14px;
    background-color: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.eg-filter-select:focus {
    border-color: #ff6b00;
    background-color: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(255, 107, 0, 0.15);
}

.eg-reset-btn {
    height: 48px;
    padding: 0 18px;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.eg-reset-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* --- Results Telemetry Bar --- */
.eg-telemetry-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
    padding: 0 4px;
}

.eg-results-count {
    font-size: 14.5px;
    color: #475569;
    font-weight: 500;
}

.eg-results-count strong {
    color: #0f172a;
    font-weight: 800;
}

.eg-active-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.eg-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff1ef;
    color: #ff6b00;
    border: 1px solid #ffd3cd;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.eg-filter-chip i {
    cursor: pointer;
    font-size: 11px;
    padding: 2px;
    border-radius: 50%;
    transition: background 0.15s;
}

.eg-filter-chip i:hover {
    background: rgba(255, 107, 0, 0.18);
}

.eg-page-indicator {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 14px;
    border-radius: 20px;
}

/* --- Directory Card Design --- */
@keyframes egCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.eg-dir-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: egCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    position: relative;
}

.eg-dir-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 42px -10px rgba(15, 23, 42, 0.12), 0 0 0 1.5px rgba(255, 107, 0, 0.28);
    border-color: rgba(255, 107, 0, 0.35);
}

/* Media Thumbnail */
.eg-dir-card-media {
    position: relative;
    height: 205px;
    overflow: hidden;
    background: #0f172a;
}

.eg-dir-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
    display: block;
}

.eg-dir-card:hover .eg-dir-card-media img {
    transform: scale(1.06);
}

.eg-dir-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.65) 0%, rgba(15, 23, 42, 0) 55%);
    pointer-events: none;
}

/* Accreditation Badge (Top Left) */
.eg-dir-badge-acc {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 20px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.25);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.eg-dir-badge-acc i {
    color: #38bdf8;
}

/* Featured / Top Choice Badge (Top Right) */
.eg-dir-badge-featured {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #ff6b00 0%, #d81b04 100%);
    color: #ffffff;
    padding: 5px 13px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 30px;
    z-index: 5;
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.45);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Card Body */
.eg-dir-card-body {
    padding: 20px 22px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta Category & Rating Row */
.eg-dir-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.eg-dir-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
}

.eg-dir-cat-pill {
    background: #fff0e6;
    color: #ff6b00;
    border: 1px solid rgba(255, 107, 0, 0.2);
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.eg-dir-cat-pill.secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.eg-dir-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 800;
}

.eg-dir-rating i {
    color: #f59e0b;
}

/* Title */
.eg-dir-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
    margin: 0 0 14px;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-dir-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.eg-dir-title a:hover {
    color: #ff6b00;
}

/* Specs Grid (2x2) */
.eg-dir-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

.eg-dir-spec-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    min-width: 0;
}

.eg-dir-spec-item i {
    font-size: 13.5px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.eg-dir-spec-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eg-dir-spec-item strong {
    color: #1e293b;
    font-weight: 700;
}

/* Facilities Row */
.eg-dir-facilities-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 10px 0;
}

.facility-pill {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #bfdbfe;
    transition: all 0.2s ease;
}

.facility-pill i {
    font-size: 10px;
    color: #2563eb;
}

.facility-pill.more {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

/* Programs & Streams Strip (Replaces Fee Structure for Universities) */
.eg-dir-programs-strip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.eg-dir-card:hover .eg-dir-programs-strip {
    border-color: rgba(255, 107, 0, 0.28);
    background: #fffdfb;
}

.eg-dir-programs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.eg-dir-programs-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.eg-dir-programs-label i {
    color: #ff6b00;
    font-size: 12.5px;
}

.eg-dir-programs-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: #10b981;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 2px 7px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.eg-dir-programs-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.eg-program-pill {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 2.5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    transition: all 0.2s ease;
}

.eg-program-pill:hover {
    color: #ff6b00;
    border-color: rgba(255, 107, 0, 0.4);
    background: #fff8f5;
}

.eg-program-pill.more {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
    font-weight: 700;
}

/* Fee Highlight Banner (Retained for colleges if needed) */
.eg-dir-fee-banner {
    background: #fff5f3;
    border: 1px solid #ffd9d3;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.eg-dir-fee-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #991b1b;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.eg-dir-fee-amount {
    font-size: 13.5px;
    font-weight: 800;
    color: #ff6b00;
}

/* Excerpt / Highlights */
.eg-dir-desc {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.55;
    margin-top: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

/* Card Footer Actions */
.eg-dir-card-footer {
    background: #fafbfc;
    border-top: 1px solid #f1f5f9;
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.eg-btn-dir-details {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    background: #ffffff;
    color: #334155;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.eg-btn-dir-details:hover {
    border-color: #ff6b00;
    color: #ff6b00;
    background: #fff8f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.1);
}

.eg-btn-dir-apply {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    background: linear-gradient(135deg, #ff6b00 0%, #ea580c 100%);
    color: #ffffff !important;
    border: 1.5px solid #ea580c;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.28);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.eg-btn-dir-apply:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    border-color: #c2410c;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 0, 0.42);
}

.eg-btn-dir-apply i {
    transition: transform 0.25s ease;
}

.eg-btn-dir-apply:hover i {
    transform: scale(1.15) rotate(-6deg);
}

/* --- Pagination Controls --- */
.eg-pagination-section {
    margin-top: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.eg-pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    flex-wrap: wrap;
    justify-content: center;
}

.eg-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    text-decoration: none;
    user-select: none;
}

.eg-page-btn:hover:not(:disabled):not(.active) {
    background: #f1f5f9;
    color: #ff6b00;
    border-color: #e2e8f0;
}

.eg-page-btn.active {
    background: #ff6b00;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(255, 107, 0, 0.35);
    border-color: #ff6b00;
}

.eg-page-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

.eg-page-ellipsis {
    min-width: 24px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: bold;
    user-select: none;
}

.eg-page-arrow {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.eg-pagination-summary {
    font-size: 13.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.eg-jump-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.eg-jump-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #334155;
    outline: none;
}

/* --- Empty Results State --- */
.eg-empty-state-box {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.eg-empty-state-box i.empty-icon {
    font-size: 52px;
    color: #cbd5e1;
    margin-bottom: 18px;
    display: block;
}

.eg-empty-state-box h4 {
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.eg-empty-state-box p {
    color: #64748b;
    font-size: 14.5px;
    max-width: 500px;
    margin: 0 auto 22px;
    line-height: 1.6;
}

/* Mobile Responsive Refinements */
@media (max-width: 575px) {
    .eg-dir-badge-acc {
        top: 10px;
        left: 10px;
        max-width: 48%;
        font-size: 10px;
        padding: 4px 8px;
    }

    .eg-dir-badge-featured {
        top: 10px;
        right: 10px;
        font-size: 9.5px;
        padding: 4px 9px;
        letter-spacing: 0.3px;
    }

    .eg-dir-card-body {
        padding: 16px 16px 14px;
    }

    .eg-dir-card-footer {
        padding: 10px 14px;
    }

    .eg-btn-dir-details,
    .eg-btn-dir-apply {
        height: 38px;
        font-size: 11.5px;
        padding: 0 8px;
    }
}
