/*
 * DGA / Shaqra Unified Overrides
 * ------------------------------
 * Loaded site-wide AFTER style.css to retint the existing components
 * (buttons, links, cards, footer-old, etc.) to the Shaqra palette
 * WITHOUT changing layouts. Safe to drop on any page.
 *
 * Brand: #005C4B (green)  ·  #C1996C (gold)
 */

/* =====================================================
   1. GLOBAL: base typography + link color
   ===================================================== */
body,
.text-right,
.text-left,
#p_wrapper {
    font-family: 'IBM Plex Sans Arabic', 'DIN Next LT Arabic', 'Tajawal', system-ui, sans-serif;
}

/* Site-wide link tint (only where the page didn't override it) */
a {
    color: #005C4B;
}
a:hover {
    color: #003D31;
}

/* Retint anything still using the old navy / teal */
[style*="#244092"],
[style*="#18b289"],
[style*="#18B289"] {
    /* inline styles can't be killed here, but we leave a comment marker */
}

/* =====================================================
   2. LEGACY BUTTONS
   ===================================================== */

/* Primary CTA buttons used across the site */
.button_primary,
.button.button_primary,
.btn-primary,
.btn.btn-primary,
button.button_primary {
    background: #005C4B !important;
    border-color: #005C4B !important;
    color: #fff !important;
}
.button_primary:hover,
.button.button_primary:hover,
.btn-primary:hover,
.btn.btn-primary:hover,
button.button_primary:hover {
    background: #003D31 !important;
    border-color: #003D31 !important;
    color: #fff !important;
}

.btn-success,
.btn.btn-success {
    background: #005C4B !important;
    border-color: #005C4B !important;
    color: #fff !important;
}
.btn-success:hover {
    background: #003D31 !important;
    border-color: #003D31 !important;
}

/* Gold / secondary CTA */
.button.button_gold,
.btn-warning,
.btn.btn-warning {
    background: #C1996C !important;
    border-color: #C1996C !important;
    color: #fff !important;
}
.button.button_gold:hover,
.btn-warning:hover {
    background: #A07A4F !important;
    border-color: #A07A4F !important;
}

/* Outline / secondary */
.button.button_secondary,
.btn-outline-primary {
    color: #005C4B !important;
    border-color: #005C4B !important;
    background: transparent !important;
}
.button.button_secondary:hover,
.btn-outline-primary:hover {
    background: #005C4B !important;
    color: #fff !important;
}

/* =====================================================
   3. LEGACY HEADER / NAVBAR
   ===================================================== */

/* Old hover/active link color */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover,
header a.active,
.menu li a.active,
.menu li a:hover {
    color: #005C4B !important;
}

/* Old gradient top bars on the dashboard (#244092 → #18b289) */
.top-bar,
.dashboard-header,
.user-banner,
.gradient-bar {
    background: linear-gradient(90deg, #003D31 0%, #005C4B 50%, #00735E 100%) !important;
}

/* =====================================================
   4. LEGACY FOOTER (the old `.main-footer` from `igts/footer`)
   Retint to deep Shaqra green so it matches the unified footer
   when the page still includes the old footer markup.
   ===================================================== */
.main-footer,
.main-footer footer,
.main-footer .copywrite {
    background: linear-gradient(180deg, #003D31 0%, #00261E 100%) !important;
    color: rgba(255,255,255,0.8) !important;
}
.main-footer h4,
.main-footer .footer-title {
    color: #fff !important;
}
.main-footer a {
    color: rgba(255,255,255,0.7) !important;
}
.main-footer a:hover {
    color: #C1996C !important;
}
.main-footer .copywrite {
    background: rgba(0,0,0,0.25) !important;
}

/* =====================================================
   5. COURSE CARDS — legacy `.coursecard`
   ===================================================== */
.coursecard,
.course-card,
.card.coursecard {
    border-radius: 12px !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.coursecard:hover,
.course-card:hover {
    transform: translateY(-3px);
    border-color: #B8D9CF !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10) !important;
}

/* Card price/badge */
.course_card_detail .price,
.coursecard .price,
.card-price {
    color: #005C4B !important;
    font-weight: 700 !important;
}

.badge-success,
.badge.badge-success {
    background: #005C4B !important;
}
.badge-warning,
.badge.badge-warning {
    background: #C1996C !important;
    color: #fff !important;
}

/* =====================================================
   6. PAGE TITLE BANNERS (about / contact / faq / instructors)
   ===================================================== */
.page-title,
.page-header,
.inner-banner,
.breadcrumb-area {
    background: linear-gradient(135deg, #003D31 0%, #005C4B 50%, #00735E 100%) !important;
    color: #fff !important;
}
.page-title h1,
.page-header h1,
.inner-banner h1,
.breadcrumb-area h1 {
    color: #fff !important;
}
.breadcrumb-item.active,
.breadcrumb a {
    color: rgba(255,255,255,0.85) !important;
}

/* =====================================================
   7. FORMS — input focus tint
   ===================================================== */
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: #005C4B !important;
    box-shadow: 0 0 0 3px rgba(0,92,75,0.12) !important;
    outline: none !important;
}

/* =====================================================
   8. PAGINATION / TABS
   ===================================================== */
.page-item.active .page-link,
.pagination .active a {
    background-color: #005C4B !important;
    border-color: #005C4B !important;
    color: #fff !important;
}
.page-link {
    color: #005C4B !important;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    background-color: #005C4B !important;
    border-color: #005C4B !important;
    color: #fff !important;
}

/* =====================================================
   9. ALERTS / TOASTS / PROGRESS
   ===================================================== */
.alert-success {
    background: #E6F1EE !important;
    color: #003D31 !important;
    border-color: #B8D9CF !important;
}
.alert-warning {
    background: #F8F1E8 !important;
    color: #A07A4F !important;
    border-color: #D9B589 !important;
}
.progress-bar,
.progress-bar-success {
    background-color: #005C4B !important;
}

/* =====================================================
   10. CHECKBOX / RADIO / SWITCH ACCENT
   ===================================================== */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    accent-color: #005C4B;
}

/* =====================================================
   11. WHATSAPP FLOATING BUTTON
   ===================================================== */
.float .my-float,
.whatsapp-homepage-icon {
    color: #25D366;
}

/* =====================================================
   12. SCROLLBAR (subtle Shaqra tint)
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #F3F4F6;
}
::-webkit-scrollbar-thumb {
    background: #B8D9CF;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #005C4B;
}

/* =====================================================
   13. SELECTION
   ===================================================== */
::selection {
    background: #005C4B;
    color: #fff;
}
::-moz-selection {
    background: #005C4B;
    color: #fff;
}

/* =====================================================
   14. LISTING PAGES — full filter UI + cards retint
        (keeps Bootstrap layout intact; sidebar in col-md-3,
        results in col-md-9)
   ===================================================== */

/* Outer row spacing */
.dga-filter-wrap { margin: 0; }
.dga-filter-side { padding-left: 12px; padding-right: 12px; }
.dga-results-col { padding-left: 12px; padding-right: 12px; }

/* ── SIDEBAR CARD ── */
.dga-filter-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 100px;
    width: 100% !important;
}

/* Header */
.dga-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #003D31 0%, #005C4B 100%);
    color: #fff;
    border-bottom: 1px solid #E5E7EB;
}
.dga-filter-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dga-filter-head svg { color: #D9B589; }
.dga-filter-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.dga-filter-toggle:hover {
    background: rgba(255,255,255,0.25);
}
.dga-filter-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }

/* Active filter banner */
.dga-filter-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #FDF8E7;
    border-bottom: 1px solid #F0E5C8;
}
.dga-filter-active-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #A07A4F;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.dga-filter-active-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #C1996C;
    border-radius: 50%;
}
.dga-filter-clear {
    background: transparent;
    border: none;
    color: #A07A4F;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.dga-filter-clear:hover {
    background: rgba(193,153,108,0.15);
    color: #005C4B;
}

/* Body */
.dga-filter-body { padding: 18px 20px; }

/* Filter groups */
.dga-filter-group {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #F3F4F6;
}
.dga-filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.dga-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
}
.dga-filter-label svg { color: #005C4B; flex-shrink: 0; }

/* Input wrap (with clear button) */
.dga-filter-input-wrap {
    position: relative;
}
.dga-filter-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    color: #111827;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    direction: rtl;
}
.dga-filter-input:focus {
    border-color: #005C4B;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,92,75,0.12);
    outline: none;
}
.dga-filter-input::placeholder { color: #9CA3AF; }
.dga-filter-input-clear {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E5E7EB;
    border: none;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.dga-filter-input-clear:hover {
    background: #DC3545;
    color: #fff;
}

/* Select wrap (custom arrow) */
.dga-filter-select-wrap {
    position: relative;
}
.dga-filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 12px;
    padding-left: 36px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    direction: rtl;
}
.dga-filter-select:focus {
    border-color: #005C4B;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,92,75,0.12);
    outline: none;
}
.dga-filter-select-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #6B7280;
    pointer-events: none;
}

/* Small variant for top-bar quick sort */
.dga-filter-select--sm {
    padding: 7px 10px;
    padding-left: 30px;
    font-size: 0.82rem;
    border-radius: 6px;
    min-width: 160px;
}

/* Visually hide native inputs */
.dga-vis-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
    padding: 0;
    margin: -1px;
}

/* Ratings */
.dga-filter-stars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dga-filter-star-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin: 0;
}
.dga-filter-star-row:hover {
    background: #F9FAFB;
}
.dga-filter-star-row.is-checked {
    background: #E6F1EE;
}
.dga-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.dga-star-on  { color: #C1996C; }
.dga-star-off { color: #E5E7EB; }
.dga-filter-star-text {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 500;
}
.dga-filter-star-row.is-checked .dga-filter-star-text {
    color: #005C4B;
    font-weight: 700;
}

/* Duration pills */
.dga-filter-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.dga-filter-pill {
    margin: 0;
    cursor: pointer;
    display: block;
}
.dga-filter-pill span {
    display: block;
    text-align: center;
    padding: 9px 10px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    transition: all 0.2s;
}
.dga-filter-pill:hover span {
    border-color: #B8D9CF;
    background: #fff;
}
.dga-filter-pill.is-checked span {
    background: #005C4B;
    border-color: #005C4B;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,92,75,0.20);
}

/* Reset button */
.dga-filter-reset-btn {
    width: 100%;
    margin-top: 18px;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid #E5E7EB;
    color: #6B7280;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.dga-filter-reset-btn:hover {
    border-color: #DC3545;
    color: #DC3545;
    background: #FEF2F2;
}

/* ── RESULTS COLUMN ── */
.dga-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dga-results-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6B7280;
    font-size: 0.92rem;
}
.dga-results-count strong {
    font-size: 1.2rem;
    font-weight: 800;
    color: #005C4B;
}
.dga-results-query {
    background: #E6F1EE;
    color: #005C4B;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 8px;
}
.dga-results-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dga-results-sort label {
    margin: 0;
    font-size: 0.85rem;
    color: #6B7280;
    font-weight: 600;
}

/* Empty state */
.dga-empty {
    background: #fff;
    border: 1.5px dashed #E5E7EB;
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    color: #6B7280;
}
.dga-empty-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #E6F1EE;
    color: #005C4B;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dga-empty h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}
.dga-empty p {
    margin: 0 0 20px;
    color: #6B7280;
}
.dga-empty .dga-btn {
    display: inline-flex;
}

/* Loading state */
.dga-results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: #6B7280;
    font-size: 0.9rem;
}
.dga-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E7EB;
    border-top-color: #005C4B;
    border-radius: 50%;
    animation: dgaSpin 0.7s linear infinite;
}
@keyframes dgaSpin {
    to { transform: rotate(360deg); }
}

/* Tighten the legacy course_card_link a bit on listing */
.dga-results-col .course_card_link {
    display: block;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    margin-bottom: 16px;
    text-decoration: none;
}
.dga-results-col .course_card_link:hover {
    transform: translateY(-3px);
    border-color: #B8D9CF;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-decoration: none;
}
.dga-results-col .course_card_link hr { display: none; }

/* Pagination */
.dga-pagination {
    justify-content: center !important;
    margin-top: 24px;
}
.dga-pagination .pagination,
.global-pagenation .pagination {
    display: inline-flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.dga-pagination .page-link,
.global-pagenation .page-link {
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #E5E7EB;
    color: #374151;
    background: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}
.dga-pagination .page-item:hover .page-link {
    border-color: #005C4B;
    color: #005C4B;
}
.dga-pagination .page-item.active .page-link {
    background: #005C4B;
    border-color: #005C4B;
    color: #fff;
}

/* Mobile: stack sidebar on top */
@media (max-width: 900px) {
    .dga-filter-card {
        position: static;
        margin-bottom: 16px;
    }
    .dga-filter-side,
    .dga-results-col {
        max-width: 100%;
        flex: 0 0 100%;
    }
    .dga-results-head { flex-direction: column; align-items: flex-start; }
    .dga-filter-pills { grid-template-columns: 1fr 1fr; }
}

/* OLD listing override block kept below for any legacy includes */

/* Sidebar filter card — visual retint, keep layout */
.dga-listing .b_all {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dga-listing .filters h6 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
}
.dga-listing .filters h6::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 13px;
    background: #C1996C;
    border-radius: 2px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Filter inputs — focus ring tinted, no layout changes */
.dga-listing .filters input[type="text"],
.dga-listing .filters select.form-control {
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
}
.dga-listing .filters input[type="text"]:focus,
.dga-listing .filters select.form-control:focus {
    border-color: #005C4B;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,92,75,0.12);
    outline: none;
}

/* Stars in rating filter */
.dga-listing .star-rating.checked { color: #F0C842; }

/* Course cards — visual retint only */
.dga-listing .coursecard,
.dga-listing .course_card_outter,
.dga-listing .course_card {
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dga-listing .coursecard:hover,
.dga-listing .course_card_outter:hover {
    transform: translateY(-3px);
    border-color: #B8D9CF;
    box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}
.dga-listing .price,
.dga-listing .card-price {
    color: #005C4B;
    font-weight: 700;
}

/* Pagination — Shaqra green, gentle override */
.dga-listing .pagination,
.global-pagenation .pagination {
    gap: 6px;
}
.dga-listing .page-link,
.global-pagenation .page-link {
    border-radius: 8px;
    border: 1.5px solid #E5E7EB;
    color: #374151;
    background: #fff;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
}
.dga-listing .page-item:hover .page-link,
.global-pagenation .page-item:hover .page-link {
    border-color: #005C4B;
    color: #005C4B;
}
.dga-listing .page-item.active .page-link,
.global-pagenation .page-item.active .page-link {
    background: #005C4B;
    border-color: #005C4B;
    color: #fff;
}
