/* ============================================================
   TGD Course Catalog (/courses)
   Used by resources/views/livewire/courses/course-list.blade.php
   ============================================================ */

body {
    background: #f7f7f7;
}

.hidden {
    display: none;
}

.side-join-newsletter {
    display: none;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.cl-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #14132e 0%, #1c1741 55%, #171636 100%);
    padding: 90px 0 130px;
}

.cl-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cl-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.cl-orb-1 {
    width: 440px;
    height: 440px;
    background: #3f1190;
    top: -140px;
    left: -100px;
    opacity: 0.6;
}

.cl-orb-2 {
    width: 380px;
    height: 380px;
    background: #2f57ef;
    bottom: -160px;
    right: 6%;
    opacity: 0.35;
}

.cl-orb-3 {
    width: 280px;
    height: 280px;
    background: #f2b705;
    top: 8%;
    right: -80px;
    opacity: 0.16;
}

.cl-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 35%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 35%, #000 25%, transparent 75%);
}

.cl-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.cl-hero-eyebrow {
    color: #f2b705;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.cl-hero-title {
    color: #fff;
    font-size: 52px;
    line-height: 1.12;
    font-weight: 800;
    margin-bottom: 16px;
}

.cl-hero-accent {
    background: linear-gradient(90deg, #f2b705 0%, #c89bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.cl-hero-sub {
    color: rgba(255, 255, 255, 0.72);
    font-size: 17px;
    margin-bottom: 30px;
}

.cl-hero-search {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    padding: 5px 8px 5px 24px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.cl-hero-search:focus-within {
    border-color: rgba(242, 183, 5, 0.55);
    background: rgba(255, 255, 255, 0.12);
}

.cl-hero-search > i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    flex-shrink: 0;
}

.cl-hero-search input[type='search'] {
    flex: 1;
    min-width: 0;
    height: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 16px;
}

.cl-hero-search input[type='search']:focus {
    outline: none;
    box-shadow: none;
}

.cl-hero-search input[type='search']::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.cl-hero-search input[type='search']::-webkit-search-cancel-button {
    display: none;
}

.cl-hero-clear {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 15px;
    transition: background 0.25s ease;
}

.cl-hero-clear:hover {
    background: rgba(255, 255, 255, 0.26);
}

/* Hero entrance */
.cl-rise {
    animation: clRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes clRise {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cl-rise {
        animation: none;
    }
}

/* ------------------------------------------------------------
   Sticky search (fixed bar revealed past the hero —
   body.cl-search-stuck is toggled by an IntersectionObserver)
   ------------------------------------------------------------ */
.cl-sticky-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: rgba(20, 19, 46, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

body.cl-search-stuck .cl-sticky-search {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cl-sticky-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
}

.cl-sticky-search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    padding: 0 6px 0 18px;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.cl-sticky-search-inner:focus-within {
    border-color: rgba(242, 183, 5, 0.55);
    background: rgba(255, 255, 255, 0.12);
}

.cl-sticky-search-inner > i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    flex-shrink: 0;
}

.cl-sticky-search-inner input[type='search'] {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
}

.cl-sticky-search-inner input[type='search']:focus {
    outline: none;
    box-shadow: none;
}

.cl-sticky-search-inner input[type='search']::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.cl-sticky-search-inner input[type='search']::-webkit-search-cancel-button {
    display: none;
}

.cl-sticky-search-inner .cl-hero-clear {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

/* Dark variants for the toolbar controls inside the sticky panel */
.cl-sticky-search .cl-filter-toggle {
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.cl-sticky-search .cl-filter-toggle:hover {
    border-color: rgba(242, 183, 5, 0.65);
    color: #f2b705;
}

.cl-sticky-search .cl-view-switch .course-switch-layout {
    background: rgba(255, 255, 255, 0.08);
}

.cl-sticky-search .cl-view-switch .course-switch-item button {
    color: rgba(255, 255, 255, 0.6);
}

.cl-sticky-search .cl-view-switch .course-switch-item button:hover {
    color: #fff;
}

.cl-sticky-search .cl-view-switch .course-switch-item button.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: none;
}

.cl-sticky-search .cl-result-count {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.cl-sticky-search .cl-result-count strong {
    color: #fff;
}

.cl-sticky-search .cl-sort {
    border-left-color: rgba(255, 255, 255, 0.14);
}

.cl-sticky-search .cl-sort-label {
    color: rgba(255, 255, 255, 0.5);
}

.cl-sticky-search select.cl-sort-select {
    height: 40px;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.cl-sticky-search select.cl-sort-select option {
    color: #171636;
}

.cl-sticky-search .cl-active-filters {
    margin: 10px 0 0;
}

.cl-sticky-search .cl-active-chip {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.cl-sticky-search .cl-active-chip-cat {
    color: rgba(255, 255, 255, 0.55);
}

.cl-sticky-search .cl-active-chip-x {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.cl-sticky-search .cl-active-chip-x:hover {
    background: #fff;
    color: #171636;
}

.cl-sticky-search .cl-clear-filters {
    color: rgba(255, 255, 255, 0.6);
}

.cl-sticky-search .cl-clear-filters:hover {
    color: #fff;
}

/* ------------------------------------------------------------
   Toolbar (overlapping card under the hero)
   ------------------------------------------------------------ */
.cl-toolbar {
    position: relative;
    z-index: 5;
    margin-top: -58px;
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #e9ecf5;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(23, 22, 54, 0.08);
    padding: 18px 22px;
}

.cl-toolbar--flat {
    margin-top: 0;
}

.cl-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cl-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e9ecf5;
    border-radius: 9999px;
    background: #f7f8fd;
    color: #4b5067;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.25s ease;
}

.cl-type-chip img {
    width: 16px;
    height: 16px;
}

.cl-type-chip sup {
    font-size: 9px;
}

.cl-type-chip:hover {
    background: #fff;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.cl-type-chip.is-active,
.cl-type-chip.is-active:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(47, 87, 239, 0.3);
}

/* Compact variant for the sidebar Type widget */
.cl-type-chips--sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cl-type-chips--sidebar .cl-type-chip {
    padding: 7px 13px;
    font-size: 13px;
}

.cl-type-chips--sidebar .cl-type-chip img {
    width: 14px;
    height: 14px;
}

.cl-toolbar-divider {
    height: 1px;
    background: #eef0f7;
    margin: 16px 0;
}

.cl-results-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 14px;
}

.cl-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e9ecf5;
    border-radius: 9999px;
    background: #fff;
    color: #171636;
    padding: 0 18px;
    height: 42px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.cl-filter-toggle i {
    font-size: 15px;
}

.cl-filter-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.cl-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 9999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* Grid / list switch (theme JS hooks on .rbt-grid-view / .rbt-list-view) */
.cl-view-switch .course-switch-layout {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 4px;
    background: #f1f2f8;
    border-radius: 9999px;
}

.cl-view-switch .course-switch-item button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #6b7088;
    font-size: 15px;
    transition: all 0.25s ease;
}

.cl-view-switch .course-switch-item button .text {
    display: none;
}

.cl-view-switch .course-switch-item button:hover {
    color: #171636;
}

.cl-view-switch .course-switch-item button.active {
    background: #fff;
    color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(23, 22, 54, 0.12);
}

.cl-result-count {
    color: #6b7088;
    font-size: 14px;
}

.cl-result-count strong {
    color: #171636;
    font-weight: 700;
}

.cl-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid #e9ecf5;
}

.cl-sort-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9aa0b5;
    white-space: nowrap;
}

select.cl-sort-select {
    height: 42px;
    border: 1px solid #e9ecf5;
    border-radius: 9999px;
    background-color: #fff;
    color: #171636;
    font-size: 14px;
    font-weight: 600;
    padding: 0 38px 0 18px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7088' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color 0.25s ease;
    cursor: pointer;
}

select.cl-sort-select:hover,
select.cl-sort-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: none;
}

/* ------------------------------------------------------------
   Active filter chips
   ------------------------------------------------------------ */
.cl-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
}

.cl-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    background: rgba(47, 87, 239, 0.08);
    border: 1px solid rgba(47, 87, 239, 0.16);
    padding: 6px 8px 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #171636;
}

.cl-active-chip-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a81a3;
}

.cl-active-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 22, 54, 0.08);
    color: #4b5067;
    font-size: 11px;
    line-height: 1;
    transition: all 0.2s ease;
}

.cl-active-chip-x:hover {
    background: #171636;
    color: #fff;
}

.cl-clear-filters {
    border: 0;
    background: transparent;
    color: #6b7088;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.cl-clear-filters:hover {
    color: #d93025;
}

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */
.rbt-sidebar-widget-wrapper.sticky-top {
    position: sticky;
    top: 100px;
}

/* The theme styles the wrapper itself as a card — strip it so only the
   individual widgets are framed (no double box) */
.cl-sidebar {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    cursor: default;
}

.cl-sidebar .rbt-single-widget {
    background: #fff;
    border: 1px solid #e9ecf5;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(23, 22, 54, 0.05);
    padding: 24px;
    margin-bottom: 20px;
}

.cl-sidebar .rbt-single-widget .inner {
    padding: 0;
}

.cl-sidebar .rbt-widget-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9aa0b5;
    margin-bottom: 16px;
    padding: 0;
    border: 0;
}

.cl-sidebar .rbt-check-group label {
    font-size: 15px;
    color: #4b5067;
}

.cl-sidebar .rbt-lable.count {
    border-radius: 9999px;
    background: #f1f2f8;
    color: #6b7088;
    font-size: 12px;
    font-weight: 600;
    padding: 1px 9px;
}

.tgd-sidebar-preview-list {
    max-height: 270px;
    overflow: hidden;
}

.cl-sidebar .tgd-show-more-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: #eef1fb;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.25s ease;
}

.cl-sidebar .tgd-show-more-trigger:hover {
    background: #e2e8f9;
}

/* The theme pins the chevron to the button's right edge — flow it inline
   next to the centered label instead */
.cl-sidebar .tgd-show-more-trigger::after {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    margin-left: 6px;
    font-size: 14px;
    line-height: 1;
}

/* ------------------------------------------------------------
   Course grid + cards
   ------------------------------------------------------------ */
.cl-page .rbt-course-grid-column .course-grid-3 .rbt-card {
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e9ecf5;
    box-shadow: 0 18px 40px rgba(23, 22, 54, 0.06);
}

.cl-page .rbt-card .rbt-card-img a img {
    border-radius: 12px;
}

.rbt-card .rbt-card-body .rbt-card-text.tgd-course-card-description,
.rbt-card .rbt-card-body .rbt-card-text.tgd-course-card-description * {
    font-size: 14px;
}

/* Four columns when the sidebar is collapsed (grid view only —
   the theme's list view needs items at full width) */
@media (min-width: 1200px) {
    .cl-main--full .rbt-course-grid-column:not(.active-list-view) .course-grid-3 {
        width: 25%;
    }
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.tgd-pagination ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tgd-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #e9ecf5;
    border-radius: 9999px;
    background: #fff;
    color: #4b5067;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(23, 22, 54, 0.04);
    transition: all 0.25s ease;
}

.tgd-page-btn i {
    font-size: 16px;
}

button.tgd-page-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.tgd-page-btn.is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(47, 87, 239, 0.35);
}

.tgd-page-btn.is-disabled {
    opacity: 0.4;
    box-shadow: none;
    pointer-events: none;
}

.tgd-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 44px;
    color: #9aa0b5;
    font-weight: 600;
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.cl-page .no-content {
    background: #fff;
    border: 1px solid #e9ecf5;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(23, 22, 54, 0.05);
}

/* ------------------------------------------------------------
   Filter modals
   ------------------------------------------------------------ */
.tgd-modal-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.tgd-modal-cancel-btn,
.tgd-modal-cancel-btn:hover,
.tgd-modal-cancel-btn:focus {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media only screen and (max-width: 991px) {
    .cl-hero {
        padding: 70px 0 110px;
    }

    .cl-hero-title {
        font-size: 40px;
    }
}

@media only screen and (max-width: 767px) {
    .cl-hero {
        padding: 56px 0 100px;
    }

    .cl-hero-title {
        font-size: 32px;
    }

    .cl-hero-sub {
        font-size: 15px;
    }

    .cl-hero-search input[type='search'] {
        height: 48px;
        font-size: 15px;
    }

    .cl-toolbar {
        padding: 16px;
        border-radius: 16px;
    }

    .cl-type-chip {
        padding: 8px 14px;
        font-size: 13px;
    }

    .cl-sort {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        width: 100%;
    }

    select.cl-sort-select {
        flex: 1;
    }

    .tgd-page-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* Sticky panel: keep search + filter toggle + sort, drop the rest */
    .cl-sticky-search .cl-result-count,
    .cl-sticky-search .cl-view-switch {
        display: none;
    }

    .cl-sticky-search .cl-sort {
        width: auto;
        margin-left: auto;
    }

    .cl-sticky-search .cl-filter-toggle span:not(.cl-filter-count) {
        display: none;
    }
}
