/* =========================================================================
   PROGRAMS PAGE REDESIGN - PREMIUM EDITION
   Professional, Modern, Visually Rich Design
   ========================================================================= */

/* FIX: Hide blue glow overlay from browser extension/dev tools */
#preact-border-shadow-host {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =====================
   PAGE LAYOUT & CONTAINER
   ===================== */

.main-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

.wrap-courses {
    position: relative;
}

/* =====================
   BREADCRUMB ENHANCEMENT
   ===================== */

.breadcrumbs {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 16px 24px !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 32px !important;
    border: none;
}

.breadcrumbs li {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
}

.breadcrumbs li a {
    color: #B8860B;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.breadcrumbs li a:hover {
    color: #8B6914;
    transform: translateX(-2px);
}

.breadcrumbs .icon-home,
.breadcrumbs .icon-arrow-right {
    font-size: 14px;
}

/* =====================
   PREMIUM FILTER SIDEBAR
   ===================== */

.tf-sidebar.course {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    padding: 18px 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 96px;
}

.sidebar-item.widget {
    border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.sidebar-item.widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Sidebar Title/Header */

.sidebar-title {
    padding: 12px 16px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background: linear-gradient(120deg, #fffdf7 0%, #ffffff 70%);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid rgba(14, 24, 35, 0.06);
    width: 100%;
}

.sidebar-title:hover {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.sidebar-title h5 {
    font-size: 15px;
    font-weight: 700;
    color: #101828;
    margin: 0;
    margin-right: auto;
}

.sidebar-title .tf-collapse-icon {
    font-size: 16px;
    color: #b88417;
    transition: transform 0.18s ease, color 0.18s ease;
    margin-left: 6px;
}

.sidebar-title[aria-expanded="true"] .tf-collapse-icon {
    transform: rotate(180deg);
    color: #b8860b;
}

/* inline filter search (Institute only) */
.filter-search {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(16, 24, 40, 0.12);
    background: #fff;
    font-size: 14px;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-search:focus {
    border-color: #b8860b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

/* Filter List */
.tf-collapse-content {
    margin-top: 12px;
    padding: 0 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    transition: max-height 0.35s ease, opacity 0.22s ease, padding 0.22s ease;
}

.tf-collapse-content.is-open {
    max-height: 420px;
    padding: 12px;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
    overflow-y: auto;
}

.tf-collapse-content .filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-search-wrap {
    margin-bottom: 10px;
}

.tf-collapse-content::-webkit-scrollbar {
    width: 6px;
}

.tf-collapse-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.tf-collapse-content::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 10px;
}

.tf-collapse-content::-webkit-scrollbar-thumb:hover {
    background: #8B6914;
}

/* Mobile Optimizations */
@media (max-width: 991px) {

    /* Add bottom padding to offcanvas body to prevent overlap with mobile menu */
    .offcanvas-body {
        padding-bottom: 100px !important;
    }

    /* Ensure tf-collapse-item has proper spacing */
    .tf-collapse-item {
        margin-bottom: 8px;
    }

    /* Optimize filter search box for mobile */
    .filter-search-wrap {
        margin-bottom: 12px;
    }

    .filter-search {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        transition: border-color 0.2s ease;
    }

    .filter-search:focus {
        outline: none;
        border-color: #B8860B;
        box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
    }
}

/* Custom Checkbox Styling */
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.18s ease, transform 0.18s ease;
    cursor: pointer;
    margin-bottom: 6px;
}

.checkbox-item:hover {
    background: rgba(184, 134, 11, 0.03);
    transform: translateX(2px);
}

.checkbox-item input[type="checkbox"] {
    /* Hide default checkbox but keep accessible */
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-item label {
    display: block;
    cursor: pointer;
    width: 100%;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    position: relative;
    padding-left: 34px;
}

/* Custom Checkbox Box */
.checkbox-item label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #e6e9ee;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

/* Custom Checkbox Checkmark */
.checkbox-item label::after {
    content: "\2713";
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.18s ease;
}

/* Checked State */
.checkbox-item input[type="checkbox"]:checked+label::before {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    border-color: #B8860B;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

.checkbox-item input[type="checkbox"]:checked+label::after {
    transform: translateY(-50%) scale(1);
}

.checkbox-item input[type="checkbox"]:checked+label {
    color: #1d2330;
    font-weight: 600;
}

/* Count Badge */
.checkbox-item span {
    margin-left: auto;
    background: #f3f4f6;
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 10px;
    min-width: 34px;
    text-align: center;
}

.checkbox-item:hover span {
    background: #b8860b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.18);
}

/* =====================
   SORT & FILTER CONTROLS
   ===================== */

.sort-by-wrap {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border: none;
}

/* Ensure sort-wrap child also uses space-between */
.sort-by-wrap .sort-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sort-by-wrap .text-1 {
    font-size: 15px;
    font-weight: 600;
    color: #1d2330;
}

.sort-by-wrap .text-2 {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-right: 12px;
}

/* Custom Select Dropdown */
.nice-select {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 40px 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2330;
    min-width: 180px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.nice-select:hover {
    border-color: #B8860B;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.15);
}

.nice-select:after {
    border-color: #B8860B;
    right: 16px;
}

.nice-select.open .list {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 2px solid #B8860B;
    margin-top: 8px;
}

.nice-select .list .option {
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nice-select .list .option:hover {
    background: linear-gradient(to right, rgba(184, 134, 11, 0.1), rgba(184, 134, 11, 0.05));
    color: #B8860B;
    font-weight: 600;
}

/* =====================
   PREMIUM COURSE CARDS
   ===================== */

.course-item.style-row {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    border: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    position: relative;
}

.course-item.style-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #B8860B 0%, #DAA520 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.course-item.style-row:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(184, 134, 11, 0.2);
}

/* =====================
   PAGINATION CONTROLS
   ===================== */

.pagination-theme {
    margin-top: 32px;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #fff9ef 100%);
    border: 1px solid rgba(184, 134, 11, 0.15);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    display: flex;
    justify-content: center;
    position: relative;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    /* Increased from 12px for better spacing */
    flex-wrap: wrap;
}

/* add spacing around pagination block to visually separate from content */
.pagination-theme {
    padding: 16px 24px;
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    /* Space between buttons */
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 15px;
    background: linear-gradient(90deg, #ffd27a 0%, #f6c243 50%, #b8860b 100%);
    color: #2b2b2b;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.15s ease;
    box-shadow: 0 8px 22px rgba(184, 134, 11, 0.25);
    min-width: 96px;
    text-align: center;
}

.pagination-btn:not(.disabled) {
    background: linear-gradient(90deg, #ffd27a 0%, #f6c243 45%, #b8860b 100%);
    color: #0f1724;
}

.pagination-btn:not(.disabled):hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 30px rgba(184, 134, 11, 0.32);
}

.pagination-btn.disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9aa3ad;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    border: 1px solid rgba(15, 23, 42, 0.04);
    min-width: 96px;
}

.pagination-theme.is-loading .pagination-btn:not(.disabled) {
    opacity: 0.65;
    pointer-events: none;
}

.pagination-theme::after {
    content: "";
    position: absolute;
    right: 16px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #b8860b;
    border-left-color: #f6c243;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pagination-theme.is-loading::after {
    opacity: 1;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.course-item.style-row:hover::before {
    opacity: 1;
}

/* Image Section */
.course-item .features.image-wrap {
    width: 280px;
    height: 240px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.course-item .features.image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.course-item:hover .features.image-wrap img {
    transform: scale(1.1);
}

/* Gradient Overlay on Hover */
.course-item .features.image-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(29, 35, 48, 0.7) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.course-item:hover .features.image-wrap::after {
    opacity: 1;
}

/* Content Section */
.course-item .content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Meta Section */
.course-item .content .top {
    margin-bottom: 16px;
}

.course-item .content .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    /* space between meta items */
    align-items: center;
}

.course-item .content .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    transition: all 0.3s ease;
}

.course-item .content .meta-item i {
    color: #B8860B;
    font-size: 14px;
}

.course-item:hover .content .meta-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Price */
.course-item .content .price {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #B8860B !important;
    margin: 0 !important;
    position: absolute;
    top: 24px;
    right: 24px;
    line-height: 1;
}

/* Title */
.course-item .content h5 {
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #1d2330 !important;
    margin-bottom: 12px !important;
    padding-right: 120px;
    /* Make room for price */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-item .content h5 a {
    color: #1d2330;
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-item:hover .content h5 a {
    color: #B8860B;
}

/* Short Description / Specializations */
.course-item .content .short-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    color: #6b6b6b;
    line-height: 1.5;
}

/* Author/Institute Section */
.course-item .content .author {
    margin-top: auto;
    padding-top: 16px;
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.course-item .content .author-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.course-item .content .author-item-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-item .content .author-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.course-item .content .author-item .text {
    font-size: 14px;
}

.course-item .content .author-item .text a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-item:hover .content .author-item .text a {
    color: #B8860B;
}

/* Category Badge */
.course-item .content .box-tags {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.course-item .content .box-tags .item {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.2);
}

.course-item .content .box-tags .item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.35);
}

/* =====================
   MOBILE FILTER BUTTON
   ===================== */

.tf-mobile-sidebar-btn {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tf-mobile-sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.tf-mobile-sidebar-btn i {
    font-size: 16px;
}

/* =====================
   PAGINATION STYLING
   ===================== */

.pager-style {
    margin-top: 40px;
    padding: 20px 0;
}

.pager-style table {
    margin: 0 auto;
}

.pager-style td {
    padding: 0 4px;
}

.pager-style a,
.pager-style span {
    display: inline-block;
    min-width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #ffffff;
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pager-style a:hover {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.pager-style span {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

/* =====================
   ANIMATIONS
   ===================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Additional overrides to prevent pill overlap with top border and tighten pagination ===== */

/* Remove the full-width decorative top bar from cards (we'll show small indicators on each pill instead) */
#programsPage .course-item.style-row::before {
    display: none !important;
}

/* Make room at the top of content so pill indicator doesn't get clipped */
#programsPage .course-item .content {
    padding-top: 32px;
    /* pushes content slightly down so pill indicator sits nicely */
}

/* Pill top indicator (small gold dash centered above each pill) */
/* scope indicator only to meta items inside course cards to avoid drawing lines elsewhere (eg pagination) */
#programsPage .course-item .meta-item {
    position: relative;
    /* needed for pseudo element */
}

#programsPage .course-item .meta-item::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: linear-gradient(90deg, #B8860B 0%, #DAA520 100%);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.12);
    opacity: 0.95;
}

/* Slightly lift pill when hovered, keep indicator visible but subtle */
#programsPage .course-item .meta-item:hover::before {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 18px rgba(184, 134, 11, 0.16);
}

/* Ensure indicator doesn't overflow card corners on rounded cards for course cards only */
#programsPage .course-item.style-row {
    overflow: visible;
}

/* Show decorative top bar only on hover for course cards to avoid static lines near pagination */
#programsPage .course-item.style-row::before {
    display: none !important;
}

#programsPage .course-item.style-row:hover::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #B8860B 0%, #DAA520 100%) !important;
    opacity: 1 !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 6px 18px rgba(184, 134, 11, 0.12) !important;
    transition: opacity 0.3s ease, transform 0.25s ease !important;
}

/* Tighten pager layout: prevent pager table stretching full width */
#programsPage .pager-style table {
    width: auto !important;
}

#programsPage .pager-style td {
    white-space: nowrap;
    padding: 0 6px !important;
}

/* Make pager more compact and centered */
#programsPage .pager-style {
    display: block;
    text-align: center;
}

/* Fallback: if GridView outputs extra table wrappers, target them */
#programsPage .pager-style>table {
    width: auto !important;
    margin: 0 auto !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* WOW.js Animation Classes */
.wow {
    visibility: hidden;
}

.wow.animated {
    visibility: visible;
}

/* =====================
   RESPONSIVE DESIGN
   ===================== */

@media (max-width: 1199px) {
    .course-item .features.image-wrap {
        width: 240px;
        height: 200px;
    }

    .course-item .content {
        padding: 20px;
    }

    .course-item .content h5 {
        font-size: 18px !important;
    }

    .course-item .content .price {
        font-size: 24px !important;
    }
}

@media (max-width: 991px) {
    .tf-sidebar.course {
        position: relative;
        top: 0;
        margin-bottom: 24px;
    }

    .course-item .features.image-wrap {
        width: 220px;
        height: 180px;
    }
}

@media (max-width: 767px) {
    .course-item.style-row {
        flex-direction: column;
    }

    .course-item .features.image-wrap {
        width: 100%;
        height: 220px;
    }

    .course-item .content {
        padding: 20px;
    }

    .course-item .content .price {
        position: static;
        margin-bottom: 12px;
        font-size: 26px !important;
    }

    .course-item .content h5 {
        padding-right: 0;
        font-size: 18px !important;
    }

    .sort-by-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sort-by-wrap .d-flex {
        width: 100%;
        justify-content: space-between;
    }

    .nice-select {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .breadcrumbs {
        padding: 12px 16px !important;
    }

    .course-item {
        margin-bottom: 16px;
    }

    .course-item .content .meta {
        gap: 8px;
    }

    .course-item .content .meta-item {
        font-size: 12px;
        padding: 5px 10px;
    }

    .pager-style a,
    .pager-style span {
        min-width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 13px;
    }
}

/* Prevent horizontal scroll on touch devices */
@media (max-width: 768px) {
    #programsPage .course-item .meta {
        gap: 10px;
    }

    #programsPage .course-item .meta-item {
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-width: 0;
    }
}

@media (max-width: 540px) {
    #programsPage .course-item .meta-item {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
    }

    #programsPage .course-item .meta-item p {
        white-space: normal;
    }
}

/* =====================
   EMPTY STATE
   ===================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.empty-state i {
    font-size: 64px;
    color: #e9ecef;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1d2330;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.empty-state .btn {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.35);
}

/* =====================
   LOADING SKELETON
   ===================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 240px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.skeleton-text {
    height: 20px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-text.short {
    width: 70%;
}

/* Page-specific styles for programs.aspx (scoped under #programsPage) */

/* Layout fixes for meta items (Undergraduate,4 Years, On-Campus) to prevent overlap */
#programsPage .meta {
    display: flex;
    flex-wrap: wrap;
    /* allow items to wrap to next line instead of overlapping */
    gap: 18px;
    /* space between meta items */
    align-items: center;
}

#programsPage .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    /* allow children to shrink inside flex container */
}

#programsPage .meta-item p {
    margin: 0;
    white-space: nowrap;
    /* keep icon and its label together */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure that small icons don't collide with text */
#programsPage .meta-item i {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
}

/* Make short description wrap cleanly */
#programsPage .short-description {
    margin-top: 8px;
    color: #6b6b6b;
    line-height: 1.5;
}

/* Card appearance adjustments (no table borders showing through) */
#programsPage .course-item {
    border: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06) !important;
    border-radius: 10px;
    background: #fff;
}

/* Enhanced: Fix Overlapping Meta Items (Scoped to #programsPage) */
/* Meta container with proper wrapping */
#programsPage .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

/* Each meta pill with flexible sizing to prevent overlap */
#programsPage .meta-item {
    flex: 0 1 auto;
    min-width: 110px;
    max-width: calc(33.333% - 8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Pill styling - clean card design */
#programsPage .meta-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(184, 134, 11, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    transition: all 0.3s ease;
}

/* Hover effect without border expansion */
#programsPage .meta-item:hover {
    background: linear-gradient(135deg, #fff8e8 0%, #fffbf0 100%);
    border-color: rgba(184, 134, 11, 0.3);
    box-shadow: 0 3px 8px rgba(184, 134, 11, 0.1);
    transform: translateY(-1px);
}

/* Icon styling */
#programsPage .meta-item i {
    flex: 0 0 auto;
    color: #B8860B;
    font-size: 14px;
}

/* Text within meta item */
#programsPage .meta-item p {
    margin: 0;
    line-height: 1.2;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive: stack on very small screens */
@media (max-width: 480px) {
    #programsPage .meta-item {
        flex: 0 1 100%;
        max-width: 100%;
    }
}

/* ====== PREMIUM PAGINATION REDESIGN (Scoped to #programsPage) ====== */

#programsPage .pager-style {
    padding: 12px 0 8px;
    margin-top: 8px;
    text-align: center;
}

#programsPage .pager-style table {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 6px;
}

#programsPage .pager-style td {
    padding: 0 6px;
}

/* Remove any stray decorative lines or borders around pager and center it precisely */
#programsPage .pager-style {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

#programsPage .pager-style table,
#programsPage .pager-style thead,
#programsPage .pager-style tbody,
#programsPage .pager-style tr,
#programsPage .pager-style td,
#programsPage .pager-style th {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Remove pseudo-elements that may draw lines */
#programsPage .pager-style::before,
#programsPage .pager-style::after,
#programsPage .pager-style table::before,
#programsPage .pager-style table::after {
    display: none !important;
    content: none !important;
}

/* Hide any hr or separator inside pager */
#programsPage .pager-style hr,
#programsPage .pager-style .separator,
#programsPage .pager-style .gv-separator {
    display: none !important;
}

/* Reduce spacing between pager items and style as small rounded pills */
#programsPage .pager-style a,
#programsPage .pager-style span {
    margin: 0 8px !important;
    padding: 10px 14px !important;
    min-width: 44px !important;
    height: 44px !important;
    line-height: 24px !important;
    border-radius: 10px !important;
}

/* DESKTOP & MOBILE PAGINATION - BEAUTIFUL BUTTON STYLING */

/* Apply to all screen sizes */
#programsPage .pager-style,
#programsPage .pagination-theme {
    padding-top: 16px;
    padding-bottom: 16px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Style ALL pagination links as beautiful buttons */
#programsPage .pager-style a,
#programsPage .pagination-theme a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: #ffffff;
    border: 2px solid #e9ecef;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Current page (span) */
#programsPage .pager-style span,
#programsPage .pagination-theme span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%) !important;
    color: #ffffff !important;
    border: 2px solid #B8860B !important;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.3),
        0 0 0 4px rgba(184, 134, 11, 0.1) !important;
    transform: translateY(-2px) scale(1.08);
}

/* Hover effect for links */
#programsPage .pager-style a:hover,
#programsPage .pagination-theme a:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border-color: #B8860B;
    box-shadow: 0 8px 24px rgba(184, 134, 11, 0.25), 0 4px 12px rgba(184, 134, 11, 0.15);
}

/* Active/pressed state */
#programsPage .pager-style a:active,
#programsPage .pagination-theme a:active {
    transform: translateY(-1px) scale(1.02);
}

/* Mobile responsive */
@media (max-width: 768px) {

    #programsPage .pager-style,
    #programsPage .pagination-theme {
        gap: 6px;
        padding: 12px 8px;
    }

    #programsPage .pager-style a,
    #programsPage .pagination-theme a,
    #programsPage .pager-style span,
    #programsPage .pagination-theme span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {

    #programsPage .pager-style a,
    #programsPage .pagination-theme a,
    #programsPage .pager-style span,
    #programsPage .pagination-theme span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* Mobile specific (< 576px) - Even more compact */
@media (max-width: 575px) {

    /* Further reduce spacing */
    #programsPage .pager-style table {
        border-spacing: 2px !important;
    }

    #programsPage .pager-style a,
    #programsPage .pager-style span {
        margin: 0 1px !important;
        padding: 6px 8px !important;
        min-width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    /* Larger arrows for easier tapping */
    #programsPage .pager-style a[href*="..."]::before {
        font-size: 20px !important;
    }
}

/* Small Mobile (< 480px) - Minimal footprint */
@media (max-width: 480px) {
    #programsPage .pager-style table {
        border-spacing: 1px !important;
    }

    /* Hide all except current, prev/next arrows */
    #programsPage .pager-style td:nth-child(n+3):nth-last-child(n+3):not(:has(span)) {
        display: none !important;
        /* Hide middle page numbers */
    }

    #programsPage .pager-style a,
    #programsPage .pager-style span {
        margin: 0 1px !important;
        padding: 5px 7px !important;
        min-width: 30px !important;
        height: 30px !important;
        font-size: 11px !important;
    }
}

/* Narrow Mobile (< 360px) - Maximum simplification */
@media (max-width: 360px) {

    /* Show ONLY: Prev arrow, Current page, Next arrow */
    #programsPage .pager-style td {
        display: none !important;
    }

    #programsPage .pager-style td:has(span),
    /* Current page */
    #programsPage .pager-style td:has(a[href*="..."])

    /* Nav arrows */
        {
        display: table-cell !important;
    }

    #programsPage .pager-style a,
    #programsPage .pager-style span {
        margin: 0 !important;
        padding: 4px 6px !important;
        min-width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

/* Base pagination button */
#programsPage .pager-style a,
#programsPage .pager-style span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: #ffffff;
    border: 2px solid #e9ecef;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Hover state with premium effect */
#programsPage .pager-style a:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border-color: #B8860B;
    box-shadow: 0 8px 24px rgba(184, 134, 11, 0.25), 0 4px 12px rgba(184, 134, 11, 0.15);
}

/* Active/Current page - visually distinct with golden theme */
#programsPage .pager-style span,
#programsPage .pager-style .current,
#programsPage .pager-style .active {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%) !important;
    color: #ffffff !important;
    border-color: #B8860B !important;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.3),
        0 0 0 4px rgba(184, 134, 11, 0.1) !important;
    transform: translateY(-2px) scale(1.08);
    font-weight: 700;
}

/* Shine effect on active page (narrow, non-intrusive) */
#programsPage .pager-style span::before,
#programsPage .pager-style .current::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20%;
    width: 140%;
    height: 60%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.0) 100%);
    transform: skewX(-30deg) translateX(-100%);
    animation: pagerShine 2.2s linear infinite;
    pointer-events: none;
    border-radius: 8px;
    opacity: 0.75;
}

@keyframes pagerShine {
    from {
        transform: skewX(-30deg) translateX(-100%);
    }

    to {
        transform: skewX(-30deg) translateX(100%);
    }
}

/* First/Last/Prev/Next buttons - special styling */
#programsPage .pager-style a[href*="First"],
#programsPage .pager-style a[href*="Last"],
#programsPage .pager-style a[href*="Prev"],
#programsPage .pager-style a[href*="Next"] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #B8860B;
    font-weight: 700;
    border-color: #ddd;
}

#programsPage .pager-style a[href*="First"]:hover,
#programsPage .pager-style a[href*="Last"]:hover,
#programsPage .pager-style a[href*="Prev"]:hover,
#programsPage .pager-style a[href*="Next"]:hover {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: #ffffff;
    border-color: #B8860B;
}

/* Disabled state */
#programsPage .pager-style span[disabled],
#programsPage .pager-style a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Keyboard focus for accessibility */
#programsPage .pager-style a:focus,
#programsPage .pager-style span:focus {
    outline: 3px solid rgba(184, 134, 11, 0.3);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(184, 134, 11, 0.15),
        0 8px 24px rgba(184, 134, 11, 0.2);
}

/* Ellipsis (...) styling */
#programsPage .pager-style span.ellipsis {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
    color: #999;
    transform: none;
}

/* Small screens: compact pagination */
@media (max-width: 576px) {

    #programsPage .pager-style a,
    #programsPage .pager-style span {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
        border-radius: 10px;
        padding: 0 12px;
    }

    #programsPage .pager-style table {
        border-spacing: 4px;
    }
}

/* Very small screens: hide First/Last, show only numbers */
@media (max-width: 420px) {

    #programsPage .pager-style a[href*="First"],
    #programsPage .pager-style a[href*="Last"] {
        display: none;
    }
}

/* ====== GRIDVIEW TABLE BORDER FIXES (Scoped) ====== */

#programsPage table.grid-style,
#programsPage table.grid-style thead,
#programsPage table.grid-style tbody,
#programsPage table.grid-style tr,
#programsPage table.grid-style td,
#programsPage table.grid-style th {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

#programsPage table.grid-style {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: transparent !important;
}

/* Hide injected separators */
#programsPage table.grid-style hr,
#programsPage table.grid-style .separator,
#programsPage table.grid-style .row-separator {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove pseudo-element borders */
#programsPage table.grid-style tr::before,
#programsPage table.grid-style tr::after {
    display: none !important;
    content: none !important;
}

/* Card shadow fix */
#programsPage .course-item {
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
    border-radius: 12px;
    background: #fff;
}

/* ====== END OF SCOPED PROGRAMS PAGE FIXES ====== */

.infinite-scroll-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 0 26px;
    color: #6b6b6b;
    font-size: 14px;
}

.infinite-scroll-loader.is-visible {
    display: flex;
}

.infinite-scroll-loader .loader-dots {
    display: flex;
    gap: 6px;
}

.infinite-scroll-loader .loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #b8860b;
    opacity: 0.4;
    animation: loader-bounce 1s ease-in-out infinite;
}

.infinite-scroll-loader .loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.infinite-scroll-loader .loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loader-bounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ========================================
   MOBILE APP-LIKE OPTIMIZATIONS
   Programs Page - All Screen Sizes
   ======================================== */

/* Mobile Header & Sort Section - All Mobile Devices */
@media (max-width: 991px) {
    /* Header Section */
    .sort-by-wrap {
        padding: 16px;
        margin-bottom: 16px;
        background: #fff;
        border-radius: 12px;
    }
    
    .sort-wrap {
        flex-direction: column !important;
        gap: 12px;
        align-items: stretch !important;
    }
    
    /* \"Showing X courses\" text */
    .sort-wrap .text-1 {
        font-size: 14px !important;
        font-weight: 500;
        color: #1e293b;
        width: 100%;
        text-align: left;
        padding: 0;
    }
    
    /* \"Sort by\" label and dropdown container */
    .sort-wrap .d-flex {
        flex-direction: row !important;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    
    .sort-wrap .text-2 {
        font-size: 14px !important;
        font-weight: 500;
        color: #64748b;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }
    
    /* Sort dropdown - full width and touch-friendly */
    .nice-select {
        width: 100% !important;
        min-height: 44px !important;
        height: 44px;
        padding: 10px 16px !important;
        font-size: 14px !important;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        background: #fff;
        display: flex;
        align-items: center;
    }
    
    .nice-select .current {
        font-size: 14px !important;
        line-height: 1.5;
    }
    
    .nice-select .list {
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
        border-radius: 8px;
    }
    
    .nice-select .option {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Course Cards - Mobile Single Column Layout */
@media (max-width: 991px) {
    .wrap-courses {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px 120px !important;
    }
    
    .course-item {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        background: #fff;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .course-item:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    }
    
    .course-item .img-box {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }
    
    .course-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .course-item .content {
        padding: 16px;
    }
    
    .course-item .level {
        font-size: 12px;
        padding: 4px 10px;
        margin-bottom: 8px;
        display: inline-block;
    }
    
    .course-item .price {
        font-size: 20px !important;
        font-weight: 700;
        color: #B8860B;
        margin-bottom: 8px;
        display: block;
    }
    
    .course-item .title,
    .course-item h3,
    .course-item a {
        font-size: 16px !important;
        line-height: 1.4 !important;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .course-item .meta,
    .course-item .tags {
        font-size: 13px;
        color: #64748b;
        line-height: 1.5;
    }
}

/* iPhone SE and Small Phones */
@media (max-width: 374px) {
    .sort-by-wrap,
    .wrap-courses {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .course-item .content {
        padding: 14px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 15px !important;
    }
    
    .course-item .price {
        font-size: 18px !important;
    }
}

/* Large Mobile */
@media (min-width: 414px) and (max-width: 767px) {
    .wrap-courses {
        padding: 0 20px 120px !important;
        gap: 24px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 17px !important;
    }
}

/* Tablets - 2 Column Layout */
@media (min-width: 768px) and (max-width: 991px) {
    .wrap-courses {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 24px 120px !important;
    }
    
    .sort-by-wrap {
        padding: 20px 24px;
    }
}

/* Touch-Friendly Interactions */
@media (max-width: 991px) {
    button,
    a.button,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    a,
    button {
        -webkit-tap-highlight-color: rgba(184, 134, 11, 0.1);
    }
    
    html {
        scroll-behavior: smooth;
    }
    
    .col-xl-9 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
}


/* ========================================
   ADDITIONAL DEVICE-SPECIFIC OPTIMIZATIONS
   Samsung Galaxy & iPhone 12 Pro
   ======================================== */

/* Samsung Galaxy S8+ (360x740) */
@media (min-width: 360px) and (max-width: 375px) {
    .sort-by-wrap {
        padding: 14px;
    }
    
    .wrap-courses {
        padding: 0 14px 120px !important;
        gap: 18px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 15.5px !important;
    }
}

/* Samsung Galaxy Z Fold 5 Folded (344x882) */
@media (min-width: 344px) and (max-width: 360px) {
    .sort-by-wrap {
        padding: 12px;
    }
    
    .wrap-courses {
        padding: 0 12px 120px !important;
        gap: 16px;
    }
    
    .course-item .content {
        padding: 14px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 15px !important;
        -webkit-line-clamp: 2;
    }
    
    .course-item .price {
        font-size: 18px !important;
    }
}

/* Samsung Galaxy Z Fold 5 Unfolded (884x1104) */
@media (min-width: 884px) and (max-width: 991px) {
    .wrap-courses {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 0 32px 120px !important;
    }
    
    .sort-by-wrap {
        padding: 20px 32px;
        margin-bottom: 20px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 17px !important;
    }
    
    .course-item .price {
        font-size: 22px !important;
    }
}

/* iPhone 12 Pro (390x844) */
@media (min-width: 390px) and (max-width: 413px) {
    .sort-by-wrap {
        padding: 16px;
    }
    
    .wrap-courses {
        padding: 0 16px 120px !important;
        gap: 20px;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 16px !important;
    }
    
    .course-item .price {
        font-size: 20px !important;
    }
    
    .nice-select {
        min-height: 46px !important;
        height: 46px;
    }
}

/* Ensure all Samsung/iPhone devices have smooth animations */
@media (min-width: 320px) and (max-width: 991px) {
    .course-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .course-item:active {
        transition: transform 0.1s ease;
    }
}


/* ========================================
   100% MOBILE APP LOOK - ENHANCED CARDS
   Perfect alignment and modern mobile design
   ======================================== */

@media (max-width: 991px) {
    /* Course Card - Complete Mobile Redesign */
    .course-item {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 16px !important;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
        background: #fff !important;
        border: 1px solid #f1f5f9;
        transition: all 0.2s ease;
    }
    
    /* Image Container */
    .course-item .img-box,
    .course-item .image-container,
    .course-item .course-image {
        position: relative;
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 56.25% !important; /* 16:9 ratio */
        overflow: hidden;
        background: #f8fafc;
    }
    
    .course-item .img-box img,
    .course-item .image-container img,
    .course-item .course-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Content Area */
    .course-item .content,
    .course-item .card-body {
        padding: 16px !important;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* Course Level Badge - Top */
    .course-item .level,
    .course-item .badge,
    .course-item .course-level {
        align-self: flex-start;
        font-size: 11px !important;
        font-weight: 600;
        padding: 4px 10px !important;
        border-radius: 6px;
        margin: 0 0 8px 0 !important;
        display: inline-block;
        background: #f1f5f9;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Price - Perfect Alignment */
    .course-item .price,
    .course-item .course-price,
    .course-item .fee {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 22px !important;
        font-weight: 700 !important;
        color: #B8860B !important;
        margin: 0 0 10px 0 !important;
        line-height: 1 !important;
    }
    
    /* Price Icon - Perfectly Aligned */
    .course-item .price i,
    .course-item .price svg,
    .course-item .price::before {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px !important;
        line-height: 1;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Course Title */
    .course-item .title,
    .course-item h3,
    .course-item h2,
    .course-item .course-title a {
        font-size: 17px !important;
        line-height: 1.35 !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin: 0 0 6px 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-decoration: none;
    }
    
    /* Course Subtitle/University */
    .course-item .subtitle,
    .course-item .university,
    .course-item .institution {
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #475569 !important;
        margin: 0 0 10px 0 !important;
        line-height: 1.3 !important;
    }
    
    /* Course Meta/Tags */
    .course-item .meta,
    .course-item .tags,
    .course-item .categories {
        font-size: 13px !important;
        color: #64748b !important;
        line-height: 1.5 !important;
        margin: 0 0 12px 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    /* University Logo/Badge */
    .course-item .university-logo,
    .course-item .institution-badge {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid #f1f5f9;
    }
    
    .course-item .university-logo img {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    .course-item .university-logo span {
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
    }
    
    /* Category Tags/Buttons */
    .course-item .category-badge,
    .course-item .tag-badge,
    .course-item .commerce-tag {
        display: inline-block;
        padding: 6px 14px !important;
        background: #fef3c7 !important;
        color: #92400e !important;
        border-radius: 20px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        margin-top: 8px;
        align-self: flex-start;
    }
    
    /* Card Hover/Active State */
    .course-item:active {
        transform: scale(0.98);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Ensure no flex layout conflicts */
    .course-item > * {
        flex-shrink: 0;
    }
}

/* Extra small devices - Tighter spacing */
@media (max-width: 374px) {
    .course-item .content,
    .course-item .card-body {
        padding: 14px !important;
    }
    
    .course-item .price {
        font-size: 20px !important;
    }
    
    .course-item .title,
    .course-item h3 {
        font-size: 16px !important;
    }
}
