/* =================================================================== */
/* Kimam Academy - Style.css                                           */
/* Updated: September 6, 2025 - Mobile tabs multi-line with rounded buttons */
/* =================================================================== */

/* Basic Reset and Global Styles */
/* Updated: September 6, 2025 - Mobile tabs multi-line layout with rounded buttons */
:root {
    --primary-color: #0056b3; /* A deeper blue */
    --secondary-color: #FFC107; /* A vibrant accent yellow/gold */
    --background-color: #f9f9f9;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --border-radius: 8px;
    /* Typography and spacing scale */
    --base-font-size: 16px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 40px;
    --heading-line-height: 1.25;
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--base-font-size);
}

.page-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Global box-sizing to avoid unexpected overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Make images and svgs responsive and prevent them from causing horizontal scroll */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Allow nav to wrap on small screens without forcing overflow */
#main-nav {
    flex-wrap: wrap;
}

/* Skip link visibility when focused */
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    left: auto;
    top: 10px;
    background: var(--primary-color);
    color: var(--light-text-color);
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 9999;
}

/* Focus outlines for keyboard users */
a:focus, button:focus, .course-button:focus {
    outline: 3px solid rgba(0,86,179,0.25);
    outline-offset: 2px;
}

/* Container improvements for better responsive behavior */
.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(8px, 2vw, 16px);
    box-sizing: border-box;
}

/* Ensure course-filter-bar works well with container */
.course-filter-bar.container {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

/* main styling handled via section and .container to keep layout simple */

section {
    padding: 60px 0; /* Use container inside section for padding */
    margin-bottom: 20px;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* Focus-visible for keyboard users */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(0,86,179,0.28);
    outline-offset: 2px;
}



/* Footer Styles (Module 3) */
#main-footer {
    background-color: #333;
    color: var(--light-text-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

#main-footer .container {
    padding: 0 20px;
}

.course-container {
    display: grid;
    /* keep cards a comfortable width and center the grid on large viewports */
    grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
    gap: 32px; /* Increased gap for better spacing */
    padding: 20px 0;
    justify-content: center;
    max-width: 1120px;
    margin: 0 auto;
}

/* Responsive spacing for course cards */
@media (max-width: 768px) {
    .course-container {
        gap: 20px; /* Smaller gap on mobile */
        padding: 15px 10px;
    }
}

.course-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease; /* Added background-color transition */
    display: flex;
    flex-direction: column;
    margin-bottom: 16px; /* Additional bottom margin for spacing */
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2); /* Enhanced shadow for better contrast */
    background-color: rgba(255, 255, 255, 0.95); /* Slight background tint for emphasis */
}

.course-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.course-image {
    width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-image {
    transform: scale(1.05);
}

.course-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.course-description {
    font-size: 1rem;
    flex-grow: 1;
    margin-bottom: 15px;
    line-height: 1.5;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: auto;
}

.course-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.course-button {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: bold;
}

/* Improve tappable area for buttons on touch devices */
.course-button, .btn { padding: 12px 20px; min-height: 44px; display:inline-flex; align-items:center; justify-content:center; }

.course-button:hover {
    background-color: #004494; /* Darker shade of primary */
}

/* Buttons: consistent styles */
.btn { display:inline-block; padding:10px 18px; border-radius:8px; font-weight:700; text-decoration:none; }
.btn-primary { background:var(--primary-color); color:var(--light-text-color); }
.btn-primary:hover, .btn-primary:focus { background:#004494; }
.btn-secondary { background:transparent; color:var(--primary-color); border:1px solid var(--primary-color); }
.btn-outline { background:transparent; color:var(--primary-color); border:1px solid var(--primary-color); }
.btn-outline:hover, .btn-outline:focus { background:var(--primary-color); color:var(--light-text-color); }
.btn[disabled], .btn.disabled { opacity:0.6; pointer-events:none; }

/* Instructors */
.instructors { background: transparent; padding-bottom: var(--space-3); }
.instructor-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:20px; }
.instructor-card { background:var(--card-bg); padding:16px; border-radius:10px; box-shadow:var(--shadow); text-align:center; }
.instructor-photo { width:96px; height:96px; border-radius:50%; object-fit:cover; display:block; margin:0 auto 12px; }

/* Testimonials */
.testimonials { padding: var(--space-3) 0; }
.testimonials-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:20px; }
.testimonial { background:var(--card-bg); padding:16px; border-radius:10px; box-shadow:var(--shadow); }

/* FAQ accordion */
.faq { margin-top:20px; }
.faq-item { border-bottom:1px solid #eee; padding:12px 0; }
.faq-question { cursor:pointer; font-weight:700; }
.faq-answer { display:none; margin-top:8px; }

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .instructor-grid, .testimonials-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
    .instructor-grid, .testimonials-grid { grid-template-columns: 1fr; }
    .hero-inner { flex-direction:column-reverse; text-align:center; }
    .hero-copy { max-width:100%; }
}

/* Lock body scroll when modal is open */
.modal-open { overflow: hidden; touch-action: none; }

/* Slightly smaller paddings on very small screens to prevent overflow */
@media (max-width: 420px) {
    section { padding: 28px 0; }
    h2 { font-size: 1.6rem; }
    .hero h1 { font-size: 1.4rem; }
    .logo { height: 34px; }
    .social-icon { width: 34px; height: 34px; }
}

/* Ensure modal content is scrollable on small viewports while backdrop covers full screen */
.modal-content { max-height: 90vh; overflow: auto; }

/* Modal styles */
.modal { position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:2000; }
.modal[aria-hidden="false"] { display:flex; }
.modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.5); }
.modal-content { position:relative; background:var(--card-bg); padding:20px; width:90%; max-width:800px; border-radius:10px; box-shadow:var(--shadow); z-index:2001; }
.modal-close { position:absolute; top:10px; left:10px; background:transparent; border:0; font-size:1.4rem; }

/* Social icons in footer */
.social-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid #dee2e6; /* Light grey border */
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.social-link:hover,
.social-link:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    outline: none;
}

.social-link .bi {
    font-size: 20px;
    color: #495057; /* A neutral dark grey */
    transition: color 0.2s ease-in-out;
}

.social-link:hover .bi,
.social-link:focus .bi {
    color: white;
}

#main-footer .container:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px; /* Increased gap for better spacing */
}

/* =================================================================== */
/* Header & Navigation Styles                                          */
/* =================================================================== */

#main-header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 10px 0; /* Reduced padding slightly */
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    gap: 12px;
}

.logo {
    height: 45px; /* Slightly larger logo */
}

#main-nav {
    display: flex;
    align-items: center;
    gap: 8px; /* Gap between nav items */
    list-style-type: none; /* Remove bullet points */
    margin: 0;
    padding: 0;
}

#main-header nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1rem;
    padding: 8px 16px; /* Button-like padding */
    border-radius: 6px; /* Rounded corners */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

#main-header nav a:hover,
#main-header nav a:focus {
    background-color: rgba(0, 86, 179, 0.07); /* Subtle background on hover */
    color: var(--primary-color);
}

/* Style for the "Contact Us" button to make it stand out */
#main-header nav a[href="#contact"] {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}
#main-header nav a[href="#contact"]:hover,
#main-header nav a[href="#contact"]:focus {
    background-color: #004494; /* Darker blue on hover */
}

#main-header #install-btn {
    margin-left: 8px;
    font-size: 0.9rem;
    padding: 6px 12px;
}

#nav-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#nav-toggle:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}


/* --- Mobile Navigation Styles --- */
@media (max-width: 900px) {
    #main-nav {
        display: none; /* Hide nav links by default */
        flex-direction: column;
        position: absolute;
        top: 65px; /* Position below header */
        right: 0;
        width: 100%;
        background: var(--card-bg);
        box-shadow: var(--shadow);
        padding: 0;
        gap: 0;
    }

    #main-header.nav-open #main-nav {
        display: flex !important; /* Show when toggled, overriding other display rules */
    }

    #main-header nav li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    #main-header nav li:last-child {
        border-bottom: none;
    }

    #main-header nav a {
        display: block;
        width: 100%;
        padding: 16px 24px; /* Adjusted back to standard spacing per user request */
        text-align: right;
    }

    #main-nav a:hover,
    #main-nav a:focus {
        background-color: rgba(0, 86, 179, 0.07);
    }

    /* On mobile, make the "Contact Us" button look like a regular menu item */
    #main-header nav a[href="#contact"] {
        background-color: transparent;
        color: var(--text-color);
    }

    #main-header #install-btn {
        display: block;
        width: 100%;
        padding: 16px 24px;
        text-align: right;
        border: none;
        background: transparent;
        color: var(--text-color);
        font-weight: bold;
        font-size: 1rem;
        cursor: pointer;
    }

    #nav-toggle {
        display: block; /* Show hamburger toggle */
    }

    /* When JS toggles the 'open' class, ensure nav is visible */
    #main-nav.open { display:flex !important; }
}

/* Elegant filter bar for courses */

/* Outer wrapper that centers the filter bar in the page */
#course-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(20px, 5vw, 30px) clamp(8px, 2vw, 12px);
    min-height: clamp(100px, 15vh, 120px);
    width: 100%;
}

/* =================================================================== */
/* Kimam Academy - Modern Filter Design                                */
/* Updated: September 6, 2025 - Beautiful & Responsive Filter Layout   */
/* =================================================================== */

/* Enhanced Filter Bar Styles - Modern Design */
.course-filter-bar {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 4vw, 28px);
    align-items: stretch;
    justify-content: center;
    /* Modern gradient background */
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.95) 0%, 
        rgba(248,249,250,0.9) 50%, 
        rgba(240,242,245,0.85) 100%);
    padding: clamp(24px, 6vw, 36px) clamp(20px, 5vw, 32px);
    border-radius: clamp(20px, 5vw, 28px);
    /* Enhanced shadow for depth */
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.08),
        0 8px 24px rgba(0,0,0,0.04),
        inset 0 1px 0 rgba(255,255,255,0.6);
    margin: 0 auto clamp(20px, 4vw, 32px) auto;
    border: 1px solid rgba(255,255,255,0.2);
    max-width: min(1200px, 96vw);
    width: calc(100% - clamp(16px, 3vw, 24px));
    backdrop-filter: blur(20px);
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(20px);
}

/* Subtle pattern overlay */
.course-filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0,86,179,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,193,7,0.02) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

/* Modern Filter Tabs Row */
.filter-tabs-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: clamp(8px, 2vw, 12px);
    position: relative;
    z-index: 1;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Beautiful Modern Tabs Navigation */
.filter-tabs .nav-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    padding: clamp(8px, 2vw, 12px);
    margin: 0;
    list-style: none;
    border-bottom: none;
    justify-content: center;
    gap: clamp(8px, 2vw, 12px);
    box-sizing: border-box;
    /* Smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.filter-tabs .nav-tabs::-webkit-scrollbar {
    display: none;
}

/* Modern Tab Items - Beautiful Responsive Design */
.filter-tabs .nav-tabs .nav-item {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    /* Enhanced spacing for better touch targets */
    min-width: clamp(60px, 15vw, 120px);
}

/* Stunning Modern Nav Links */
.filter-tabs .nav-tabs .nav-link {
    /* Beautiful modern button design */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(36px, 8vw, 48px);
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    
    /* Modern typography */
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    
    /* Stunning visual design */
    color: #4a5568;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%,
        rgba(248, 250, 252, 0.85) 50%,
        rgba(241, 245, 249, 0.8) 100%);
    
    /* Beautiful rounded design */
    border-radius: clamp(18px, 4vw, 24px);
    border: 2px solid rgba(226, 232, 240, 0.6);
    
    /* Elegant shadows */
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Modern glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Beautiful hover effects */
.filter-tabs .nav-tabs .nav-link:hover {
    color: #2d3748;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(248, 250, 252, 0.9) 50%,
        rgba(236, 242, 249, 0.85) 100%);
    
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Stunning active state */
.filter-tabs .nav-tabs .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, 
        #667eea 0%,
        #764ba2 50%,
        #667eea 100%);
    
    border-color: rgba(102, 126, 234, 0.8);
    transform: translateY(-1px);
    
    box-shadow: 
        0 12px 35px rgba(102, 126, 234, 0.25),
        0 6px 20px rgba(118, 75, 162, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.filter-tabs .nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: rgba(255,255,255,0.8);
    border-radius: 2px;
}

/* Filter Search Row - Cross-Platform - Contained */
.filter-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(12px, 3vw, 20px);
    flex-wrap: wrap;
    width: 100%;
    /* Ensure search elements stay within container */
    overflow: hidden;
    position: relative;
}

.filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: min(500px, 60vw);
    background: rgba(255,255,255,0.9);
    padding: clamp(2px, 0.5vw, 4px);
    border-radius: clamp(8px, 2vw, 12px);
    border: 2px solid rgba(230,233,239,0.6);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    box-sizing: border-box;
    position: relative;
}

.filter-search-wrap:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    transform: translateY(-1px);
}

.filter-search-wrap .input-group-text {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: clamp(16px, 3vw, 18px);
    padding: clamp(10px, 2vw, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-search {
    border: none;
    outline: none;
    width: 100%;
    padding: clamp(10px, 2vw, 16px);
    font-size: clamp(14px, 2.5vw, 16px);
    background: transparent;
    color: #333;
    font-weight: 500;
    min-width: 0;
    flex: 1;
}

.filter-search::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.filter-search:focus {
    box-shadow: none;
}

/* Clear Button - Cross-Platform */
.filter-clear {
    padding: clamp(10px, 2vw, 16px) clamp(16px, 4vw, 24px);
    border-radius: clamp(8px, 2vw, 12px);
    border: 2px solid #dee2e6;
    background: rgba(255,255,255,0.9);
    color: #6c757d;
    font-weight: 600;
    font-size: clamp(14px, 2.5vw, 15px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-height: clamp(40px, 8vw, 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.filter-clear:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Filter Count Badge - Cross-Platform */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), #ffc107);
    color: #222;
    padding: clamp(6px, 1.5vw, 10px) clamp(12px, 3vw, 16px);
    border-radius: clamp(16px, 4vw, 20px);
    font-weight: 700;
    font-size: clamp(12px, 2vw, 14px);
    box-shadow: 0 2px 8px rgba(255,193,7,0.3);
    min-width: clamp(50px, 8vw, 60px);
    height: clamp(28px, 6vw, 36px);
    margin-left: clamp(8px, 2vw, 12px);
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Cross-Platform Responsive Enhancements */

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .course-filter-bar {
        padding: clamp(12px, 3vw, 16px) clamp(8px, 2vw, 12px);
        gap: clamp(8px, 2vw, 12px);
        border-radius: clamp(8px, 2vw, 12px);
        box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(8px, 2vw, 12px) rgba(0, 0, 0, 0.1);
        /* Ensure all content is contained */
        overflow: hidden;
        width: calc(100% - clamp(4px, 1vw, 8px));
        max-width: calc(100% - clamp(4px, 1vw, 8px));
    }

    .filter-tabs .nav-tabs {
        gap: clamp(2px, 0.5vw, 4px);
        padding: 0 clamp(2px, 0.5vw, 4px);
        /* Keep tabs contained within the box on small screens */
        flex-wrap: wrap;
        justify-content: center;
        overflow: hidden;
    }

    .filter-tabs .nav-tabs .nav-link {
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
        font-size: clamp(12px, 2.5vw, 13px);
        max-width: min(120px, 25vw);
        border-radius: clamp(16px, 4vw, 20px);
        min-height: clamp(36px, 7vw, 44px);
        line-height: 1.2;
        /* Ensure tabs don't overflow */
        flex-shrink: 1;
        word-break: break-word;
        hyphens: auto;
    }

    .filter-search-wrap {
        padding: clamp(1px, 0.25vw, 2px);
        border-radius: clamp(6px, 1.5vw, 8px);
        box-shadow: 0 clamp(1px, 0.25vw, 2px) clamp(4px, 1vw, 6px) rgba(0, 0, 0, 0.1);
    }

    .filter-search-wrap .input-group-text {
        padding: clamp(8px, 2vw, 12px);
        font-size: clamp(14px, 3vw, 16px);
        background-color: #f8f9fa;
        border: clamp(1px, 0.25vw, 2px) solid #dee2e6;
    }

    .filter-search {
        padding: clamp(8px, 2vw, 12px);
        font-size: clamp(13px, 2.5vw, 15px);
        border: clamp(1px, 0.25vw, 2px) solid #dee2e6;
    }

    .filter-clear {
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
        font-size: clamp(13px, 2.5vw, 14px);
        border-radius: clamp(6px, 1.5vw, 8px);
        min-height: clamp(36px, 7vw, 44px);
        box-shadow: 0 clamp(1px, 0.25vw, 2px) clamp(4px, 1vw, 6px) rgba(0, 0, 0, 0.1);
    }

    .filter-count {
        min-width: clamp(40px, 6vw, 50px);
        height: clamp(24px, 4vw, 32px);
        font-size: clamp(10px, 2vw, 12px);
        border-radius: clamp(12px, 3vw, 15px);
    }
}

/* Mobile Landscape (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .course-filter-bar {
        padding: clamp(16px, 4vw, 24px) clamp(12px, 3vw, 20px);
        gap: clamp(12px, 3vw, 20px);
        border-radius: clamp(10px, 2.5vw, 16px);
        /* Keep content contained within the box */
        overflow: hidden;
    }

    .filter-tabs .nav-tabs {
        /* Force wrapping on tablets */
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(6px, 1.5vw, 10px);
        padding: 0 clamp(6px, 1.5vw, 10px);
    }

    .filter-tabs .nav-tabs .nav-link {
        padding: clamp(10px, 2.5vw, 14px) clamp(16px, 4vw, 20px);
        font-size: clamp(14px, 2.5vw, 15px);
        max-width: min(160px, 30vw);
        border-radius: clamp(16px, 4vw, 20px);
        min-height: clamp(40px, 8vw, 48px);
        /* Allow proper shrinking and wrapping */
        flex-shrink: 1;
        flex-basis: auto;
    }

    .filter-search-wrap {
        max-width: min(450px, 70vw);
        border-radius: clamp(8px, 2vw, 12px);
    }

    .filter-search-wrap .input-group-text {
        padding: clamp(10px, 2.5vw, 14px);
        font-size: clamp(16px, 3vw, 18px);
    }

    .filter-search {
        padding: clamp(10px, 2.5vw, 14px);
        font-size: clamp(14px, 2.5vw, 16px);
    }

    .filter-clear {
        padding: clamp(10px, 2.5vw, 14px) clamp(16px, 4vw, 20px);
        font-size: clamp(14px, 2.5vw, 15px);
        border-radius: clamp(8px, 2vw, 12px);
        min-height: clamp(40px, 8vw, 48px);
    }

    .filter-count {
        min-width: clamp(45px, 7vw, 55px);
        height: clamp(26px, 5vw, 32px);
        font-size: clamp(11px, 2vw, 13px);
        border-radius: clamp(13px, 3vw, 16px);
    }
}

/* Tablet Portrait (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .course-filter-bar {
        padding: clamp(20px, 5vw, 28px) clamp(16px, 4vw, 24px);
        gap: clamp(16px, 4vw, 24px);
        border-radius: clamp(12px, 3vw, 18px);
        /* Contain content within the box */
        overflow: hidden;
    }

    .filter-tabs .nav-tabs {
        /* Force wrapping on larger tablets */
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(8px, 2vw, 12px);
        padding: 0 clamp(8px, 2vw, 12px);
    }

    .filter-tabs .nav-tabs .nav-link {
        padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 24px);
        font-size: clamp(15px, 2.5vw, 16px);
        max-width: min(180px, 35vw);
        border-radius: clamp(18px, 4.5vw, 22px);
        min-height: clamp(44px, 9vw, 52px);
        /* Allow proper shrinking and wrapping */
        flex-shrink: 1;
        flex-basis: auto;
    }

    .filter-search-wrap {
        max-width: min(500px, 75vw);
        border-radius: clamp(10px, 2.5vw, 14px);
    }

    .filter-search-wrap .input-group-text {
        padding: clamp(12px, 3vw, 16px);
        font-size: clamp(18px, 3vw, 20px);
    }

    .filter-search {
        padding: clamp(12px, 3vw, 16px);
        font-size: clamp(15px, 2.5vw, 17px);
    }

    .filter-clear {
        padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 24px);
        font-size: clamp(15px, 2.5vw, 16px);
        border-radius: clamp(10px, 2.5vw, 14px);
        min-height: clamp(44px, 9vw, 52px);
    }

    .filter-count {
        min-width: clamp(50px, 8vw, 60px);
        height: clamp(28px, 5vw, 34px);
        font-size: clamp(12px, 2vw, 14px);
        border-radius: clamp(14px, 3vw, 17px);
    }
}

/* Desktop (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    .course-filter-bar {
        padding: clamp(24px, 6vw, 32px) clamp(20px, 5vw, 28px);
        gap: clamp(20px, 5vw, 28px);
        border-radius: clamp(14px, 3.5vw, 20px);
        /* Contain content within the box */
        overflow: hidden;
    }

    .filter-tabs .nav-tabs {
        /* Allow wrapping if needed on medium desktops */
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(10px, 2.5vw, 14px);
        padding: 0 clamp(10px, 2.5vw, 14px);
    }

    .filter-tabs .nav-tabs .nav-link {
        padding: clamp(14px, 3.5vw, 18px) clamp(24px, 6vw, 28px);
        font-size: clamp(16px, 2.5vw, 17px);
        max-width: min(200px, 40vw);
        border-radius: clamp(20px, 5vw, 24px);
        min-height: clamp(48px, 10vw, 56px);
        /* Allow proper shrinking and wrapping */
        flex-shrink: 1;
        flex-basis: auto;
    }

    .filter-search-wrap {
        max-width: min(550px, 80vw);
        border-radius: clamp(12px, 3vw, 16px);
    }

    .filter-search-wrap .input-group-text {
        padding: clamp(14px, 3.5vw, 18px);
        font-size: clamp(20px, 3vw, 22px);
    }

    .filter-search {
        padding: clamp(14px, 3.5vw, 18px);
        font-size: clamp(16px, 2.5vw, 18px);
    }

    .filter-clear {
        padding: clamp(14px, 3.5vw, 18px) clamp(24px, 6vw, 28px);
        font-size: clamp(16px, 2.5vw, 17px);
        border-radius: clamp(12px, 3vw, 16px);
        min-height: clamp(48px, 10vw, 56px);
    }

    .filter-count {
        min-width: clamp(55px, 9vw, 65px);
        height: clamp(30px, 5vw, 36px);
        font-size: clamp(13px, 2vw, 15px);
        border-radius: clamp(15px, 3vw, 18px);
    }
}

/* Large Desktop (1201px+) */
@media (min-width: 1201px) {
    .course-filter-bar {
        max-width: 1400px;
        padding: 32px 40px;
        gap: 28px;
        border-radius: 20px;
        /* Ensure content is contained */
        overflow: hidden;
    }

    .filter-tabs .nav-tabs .nav-link {
        padding: 16px 28px;
        font-size: 16px;
        max-width: 220px;
        border-radius: 22px;
        min-height: 52px;
        /* Ensure tabs fit within container */
        flex-shrink: 0;
    }

    .filter-search-wrap {
        max-width: 600px;
        border-radius: 14px;
    }

    .filter-search-wrap .input-group-text {
        padding: 16px 20px;
        font-size: 20px;
    }

    .filter-search {
        padding: 16px 20px;
        font-size: 16px;
    }

    .filter-clear {
        padding: 16px 28px;
        font-size: 16px;
        border-radius: 14px;
        min-height: 52px;
    }

    .filter-count {
        min-width: 60px;
        height: 32px;
        font-size: 14px;
        border-radius: 16px;
    }
}

/* On small screens we keep everything on a single row; allow horizontal scrolling instead of stacking */
@media (max-width: 520px) {
    #course-filters {
        min-height: auto;
        padding: clamp(8px, 2vw, 10px) clamp(4px, 1vw, 6px);
        overflow-x: auto; /* allow horizontal scroll if needed */
        -webkit-overflow-scrolling: touch;
    }

    .course-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: clamp(8px, 2vw, 12px);
        padding: clamp(10px, 3vw, 16px) clamp(8px, 2vw, 12px);
        width: calc(100% - clamp(8px, 2vw, 16px));
        min-width: calc(100% - clamp(8px, 2vw, 16px));
        border-radius: clamp(8px, 2vw, 12px);
        box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(8px, 2vw, 12px) rgba(0, 0, 0, 0.1);
    }

    /* ensure left/center/right sizing behaves: tabs and clear are fixed, search can shrink */
    .course-filter-bar .filter-left {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .course-filter-bar .filter-center {
        flex: 1 1 auto;
        justify-content: center;
    }

    .course-filter-bar .filter-right {
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .filter-select { min-width: 120px; font-size: 14px; }
    .filter-search-wrap { min-width: 140px; max-width: 300px; }
    .filter-search { min-width: 100px; font-size: 14px; }

/* Enhanced Mobile Responsive Behavior - Beautiful Multi-line Layout */
@media (max-width: 768px) {
    /* Container optimizations for mobile */
    .course-filter-bar {
        margin: clamp(16px, 4vw, 24px) clamp(8px, 2vw, 16px);
        padding: clamp(20px, 5vw, 28px);
        border-radius: clamp(20px, 5vw, 28px);
        /* Enhanced glassmorphism for mobile */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }
    
    .filter-tabs-row {
        margin-bottom: clamp(12px, 3vw, 16px);
    }
    
    /* Beautiful multi-line tabs on mobile - Hide extra tabs */
    .filter-tabs .nav-tabs {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: stretch !important;
        gap: clamp(8px, 2.5vw, 12px) !important;
        padding: clamp(12px, 3vw, 16px) !important;
        /* Remove any overflow restrictions for proper wrapping */
        overflow: visible !important;
        /* Enhanced mobile background */
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.1) 0%,
            rgba(248, 250, 252, 0.05) 100%) !important;
        border-radius: clamp(16px, 4vw, 20px) !important;
        margin: 0 !important;
    }
    
    /* Hide extra tabs on mobile - Show only first 6 tabs */
    .filter-tabs .nav-tabs .nav-item:nth-child(n+7) {
        display: none !important;
    }
    
    /* Show "الكل" and main categories only */
    .filter-tabs .nav-tabs .nav-item:nth-child(1),
    .filter-tabs .nav-tabs .nav-item:nth-child(2),
    .filter-tabs .nav-tabs .nav-item:nth-child(3),
    .filter-tabs .nav-tabs .nav-item:nth-child(4),
    .filter-tabs .nav-tabs .nav-item:nth-child(5),
    .filter-tabs .nav-tabs .nav-item:nth-child(6) {
        display: flex !important;
    }
    
    /* Mobile tab sizing - flexible and beautiful */
    .filter-tabs .nav-tabs .nav-item {
        /* Allow flexible sizing with minimum constraints */
        flex: 0 0 auto !important;
        min-width: clamp(80px, 22vw, 130px) !important;
        max-width: clamp(140px, 35vw, 180px) !important;
        margin: 0 !important;
    }
    
    /* Enhanced mobile nav links */
    .filter-tabs .nav-tabs .nav-link {
        width: 100% !important;
        min-height: clamp(40px, 10vw, 52px) !important;
        padding: clamp(10px, 2.5vw, 14px) clamp(16px, 4vw, 20px) !important;
        font-size: clamp(13px, 3.2vw, 16px) !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        
        /* Enhanced mobile design */
        border-radius: clamp(20px, 5vw, 26px) !important;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.95) 0%,
            rgba(248, 250, 252, 0.9) 50%,
            rgba(241, 245, 249, 0.85) 100%) !important;
        border: 2px solid rgba(226, 232, 240, 0.7) !important;
        color: #4a5568 !important;
        
        box-shadow: 
            0 6px 18px rgba(0, 0, 0, 0.08) !important,
            0 3px 8px rgba(0, 0, 0, 0.04) !important,
            inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
            
        /* Allow text wrapping on very narrow screens */
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        
        /* Enhanced mobile glassmorphism */
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
    }
    
    /* Enhanced mobile hover effects */
    .filter-tabs .nav-tabs .nav-link:hover {
        transform: translateY(-3px) !important;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 250, 252, 0.95) 50%,
            rgba(236, 242, 249, 0.9) 100%) !important;
        border-color: rgba(99, 102, 241, 0.4) !important;
        color: #2d3748 !important;
        
        box-shadow: 
            0 12px 35px rgba(99, 102, 241, 0.2) !important,
            0 6px 18px rgba(0, 0, 0, 0.12) !important,
            inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    }
    
    /* Enhanced active state on mobile */
    .filter-tabs .nav-tabs .nav-link.active {
        transform: translateY(-2px) !important;
        background: linear-gradient(135deg, 
            #667eea 0%,
            #764ba2 50%,
            #667eea 100%) !important;
        border-color: rgba(102, 126, 234, 0.9) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        
        box-shadow: 
            0 16px 45px rgba(102, 126, 234, 0.35) !important,
            0 8px 25px rgba(118, 75, 162, 0.2) !important,
            inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
            
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
    }
    
    /* Optimized search row layout - Single line with proper spacing */
    .filter-search-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: clamp(8px, 2vw, 12px) !important;
        flex-wrap: wrap !important;
        padding: clamp(8px, 2vw, 12px) !important;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.05) 0%,
            rgba(248, 250, 252, 0.02) 100%) !important;
        border-radius: clamp(12px, 3vw, 16px) !important;
        margin-top: clamp(8px, 2vw, 12px) !important;
    }

    /* Enhanced search input wrapper */
    .filter-search-wrap {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        min-width: 140px !important;
        max-width: 100% !important;
        position: relative !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: clamp(16px, 4vw, 20px) !important;
        border: 1px solid rgba(226, 232, 240, 0.6) !important;
        overflow: hidden !important;
    }

    .filter-search-wrap .input-group-text {
        background: transparent !important;
        border: none !important;
        color: #6b7280 !important;
        font-size: clamp(14px, 3.5vw, 18px) !important;
        padding: clamp(8px, 2vw, 12px) clamp(8px, 2vw, 12px) !important;
    }

    .filter-search-wrap .filter-search {
        border: none !important;
        background: transparent !important;
        font-size: clamp(12px, 3vw, 14px) !important;
        padding: clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px) !important;
        color: #374151 !important;
        box-shadow: none !important;
    }

    .filter-search-wrap .filter-search::placeholder {
        color: #9ca3af !important;
        font-size: clamp(11px, 2.8vw, 13px) !important;
    }

    .filter-search-wrap .filter-search:focus {
        outline: none !important;
        box-shadow: none !important;
    }

    /* Enhanced clear button */
    .filter-clear {
        flex: 0 0 auto !important;
        padding: clamp(6px, 1.5vw, 10px) clamp(12px, 3vw, 16px) !important;
        font-size: clamp(11px, 2.8vw, 13px) !important;
        font-weight: 600 !important;
        border-radius: clamp(14px, 3.5vw, 18px) !important;
        background: linear-gradient(135deg, 
            rgba(248, 250, 252, 0.9) 0%,
            rgba(241, 245, 249, 0.8) 100%) !important;
        border: 1px solid rgba(226, 232, 240, 0.6) !important;
        color: #6b7280 !important;
        min-width: clamp(60px, 15vw, 80px) !important;
        transition: all 0.3s ease !important;
    }

    .filter-clear:hover {
        background: linear-gradient(135deg, 
            rgba(239, 246, 255, 0.95) 0%,
            rgba(219, 234, 254, 0.9) 100%) !important;
        border-color: rgba(99, 102, 241, 0.3) !important;
        color: #4338ca !important;
        transform: translateY(-1px) !important;
    }

    /* Enhanced result count badge */
    .filter-count {
        flex: 0 0 auto !important;
        padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px) !important;
        font-size: clamp(11px, 2.8vw, 13px) !important;
        font-weight: 700 !important;
        border-radius: clamp(12px, 3vw, 16px) !important;
        background: linear-gradient(135deg, 
            #fbbf24 0%,
            #f59e0b 100%) !important;
        color: #ffffff !important;
        border: 1px solid rgba(245, 158, 11, 0.3) !important;
        min-width: clamp(40px, 10vw, 60px) !important;
        text-align: center !important;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
    }
}

/* Extra Small Mobile Devices - Enhanced Beautiful Design */
@media (max-width: 480px) {
    /* Ultra-compact filter container */
    .course-filter-bar {
        margin: clamp(12px, 3vw, 20px) clamp(6px, 1.5vw, 12px);
        padding: clamp(16px, 4vw, 24px);
        border-radius: clamp(16px, 4vw, 22px);
    }
    
    /* Hide even more tabs on very small screens - Show only first 4 tabs */
    .filter-tabs .nav-tabs .nav-item:nth-child(n+5) {
        display: none !important;
    }
    
    /* Show only essential categories */
    .filter-tabs .nav-tabs .nav-item:nth-child(1),
    .filter-tabs .nav-tabs .nav-item:nth-child(2),
    .filter-tabs .nav-tabs .nav-item:nth-child(3),
    .filter-tabs .nav-tabs .nav-item:nth-child(4) {
        display: flex !important;
    }
    
    /* Optimized tabs for very small screens */
    .filter-tabs .nav-tabs {
        gap: clamp(6px, 2vw, 10px) !important;
        padding: clamp(10px, 2.5vw, 14px) !important;
        border-radius: clamp(12px, 3vw, 16px) !important;
    }
    
    /* Compact mobile nav items */
    .filter-tabs .nav-tabs .nav-item {
        min-width: clamp(70px, 20vw, 110px) !important;
        max-width: clamp(130px, 40vw, 180px) !important;
    }
    
    /* Enhanced extra small mobile nav links */
    .filter-tabs .nav-tabs .nav-link {
        min-height: clamp(36px, 9vw, 48px) !important;
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px) !important;
        font-size: clamp(12px, 3vw, 15px) !important;
        border-radius: clamp(16px, 4vw, 22px) !important;
        
        /* Enhanced compact shadows */
        box-shadow: 
            0 4px 14px rgba(0, 0, 0, 0.06),
            0 2px 6px rgba(0, 0, 0, 0.03),
            inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }
    
    /* Compact hover effects */
    .filter-tabs .nav-tabs .nav-link:hover {
        box-shadow: 
            0 8px 22px rgba(99, 102, 241, 0.16),
            0 4px 12px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    
    /* Compact active state */
    .filter-tabs .nav-tabs .nav-link.active {
        box-shadow: 
            0 10px 30px rgba(102, 126, 234, 0.28),
            0 5px 15px rgba(118, 75, 162, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
    }
    
    /* Optimized search layout for very small screens */
    .filter-search-row {
        flex-direction: column;
        gap: clamp(6px, 1.5vw, 10px);
    }
    
    .filter-search-wrap {
        min-width: 100px;
        max-width: 100%;
    }
}

/* Tablet Layout Improvements */
@media (min-width: 521px) and (max-width: 768px) {
    #course-filters {
        padding: clamp(15px, 4vw, 25px) clamp(6px, 1.5vw, 10px);
        min-height: clamp(80px, 12vh, 100px);
    }

    .course-filter-bar {
        padding: clamp(12px, 4vw, 20px) clamp(16px, 5vw, 24px);
        gap: clamp(12px, 3vw, 20px);
    }

    .filter-search-row {
        flex-direction: row;
        justify-content: space-between;
        gap: clamp(12px, 3vw, 20px);
    }

    .filter-search-wrap {
        max-width: min(350px, 45vw);
        flex: 1;
    }

    .filter-clear {
        flex-shrink: 0;
    }

    .filter-count {
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* Hero */
.hero {
    background: linear-gradient(90deg, rgba(0,86,179,0.06), rgba(255,193,7,0.03));
    overflow: hidden; /* prevent children overflowing viewport */
    padding: 18px 0;
}
.hero-inner {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    flex-wrap: wrap; /* allow stacking on small screens */
}
.hero-copy {
    flex: 1 1 320px;
    max-width: 720px;
    box-sizing: border-box;
}
.hero h1 {
    font-size: clamp(1.4rem, 4.6vw, 3rem);
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.12;
    word-break: keep-all;
}
.hero p {
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    margin-bottom: 14px;
}

/* Larger-screen hero tweaks for better balance */
@media (min-width: 1200px) {
    .hero-inner { align-items: center; }
    .hero-copy { max-width: 720px; }
    .hero-media img { max-width: 480px; }
    .hero-media { flex: 0 0 420px; max-width: 42%; }
    .hero-copy { max-width: 820px; }
}
@media (min-width: 1400px) {
    .hero-inner {
        display: grid;
        grid-template-columns: 1fr 520px; /* text area + image column */
        align-items: center;
        gap: 48px;
    }
    .hero-copy { text-align: right; }
    .hero-media img { max-width: 520px; border-radius: 16px; }
}
.hero-media { flex: 0 0 360px; max-width: 48%; display:flex; align-items:center; justify-content:center; }
.hero-media img { max-width:100%; height:auto; object-fit:contain; border-radius:12px; display:block; }
.hero-ctas { display:flex; gap:12px; }

/* About */
.about-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:20px; margin-top:24px; }
.about-item { background:var(--card-bg); padding:20px; border-radius:10px; box-shadow:var(--shadow); }

/* Contact */
.contact-form { max-width:700px; margin:16px auto 0; }
.form-row { margin-bottom:12px; display:flex; flex-direction:column; }
/* Right-align labels and inputs for RTL layout and make inputs full-width */
.contact-form { display:flex; flex-direction:column; align-items:stretch; }
.contact-form .form-row { align-items:flex-end; text-align:right; }
.contact-form label { margin-bottom:6px; text-align:right; width:100%; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"], .contact-form textarea { padding:10px; border-radius:6px; border:1px solid #ddd; width:100%; box-sizing:border-box; text-align:right; }
/* Ensure inputs have same tappable height and readable font-size */
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"] { min-height:44px; font-size:1rem; }

/* Align the submit button to the right on larger screens */
.contact-form .form-row .btn { align-self:flex-end; }

/* On small screens inputs and buttons should span full width */
@media (max-width: 600px) {
    .contact-form .form-row { align-items:stretch; text-align:right; }
    .contact-form .form-row .btn { align-self:stretch; }
}

/* Responsive */
@media (max-width: 900px) {
    .hero-inner { flex-direction:column-reverse; text-align:center; }
    /* Force media column to behave responsively and avoid overflow */
    .hero-media {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 12px;
        box-sizing: border-box;
        order: 2; /* keep media after copy when stacking */
    }
    .hero-copy { flex: 1 1 100%; max-width: 100%; padding: 0 12px; box-sizing: border-box; }
    .hero { padding: 12px 0; }
    .hero-media img { width: 100%; max-width: 100%; height: auto; object-fit: contain; }
    .about-grid { grid-template-columns: 1fr; }
    .logo { height: 36px; }
}

/* Increase hero image visual size by ~1.5x on medium+ screens without changing layout flow */
@media (min-width: 900px) {
    .hero-media img {
        transform: scale(1.5);
        transform-origin: center right; /* keep image anchored on the media column side (RTL layout)
                                        and prevent shifting important content */
        /* allow the image to stay crisp; overflow is hidden by .hero */
    }
}

/* Extra-tight small screens adjustments */
@media (max-width: 420px) {
    .hero { padding: 8px 0; }
    .hero-copy { padding: 0 10px; }
    .hero-ctas { flex-direction: column; gap: 10px; }
    .hero h1 { font-size: clamp(1.2rem, 6.2vw, 2rem); }
}

/* Debugging overflow issues - REMOVE BEFORE PRODUCTION */
/* Debugging overflow issues removed. Use DevTools Console snippets instead when needed. */

#course-image-container {
    width: 100%;
    overflow: hidden;
    margin-bottom: 24px;
    border-radius: var(--border-radius);
    display:flex;
    align-items:center;
    justify-content:center;
}
.course-detail-image {
    width: 100%;
    height: auto; /* allow natural height so image isn't cropped */
    object-fit: contain; /* ensure the whole image is visible */
    max-height: 70vh; /* prevent image from being taller than viewport */
    display:block;
}

/* Course details two-column layout on large screens */
.course-detail-grid{
    display:block;
}
.course-detail-content{padding:0 12px}

@media (min-width: 900px){
    .course-detail-grid{ display:grid; grid-template-columns: 48% 1fr; gap: 32px; align-items:start; }
    #course-image-container{ margin-bottom:0 }
    .course-detail-image{ max-height: 60vh }
    .course-detail-content{ padding-left: 24px }
}

/* Load More Button Styles */
.load-more-container {
    margin: 3rem 0 2rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 20px;
}

.load-more-container .btn {
    padding: 18px 36px;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 220px;
    letter-spacing: 0.5px;
    text-transform: none;
    cursor: pointer;
}

.load-more-container .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.load-more-container .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.35);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    letter-spacing: 1px;
}

.load-more-container .btn:hover::before {
    left: 100%;
}

.load-more-container .btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.1s ease;
}

.load-more-container .btn:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* تأثير النبضة للزر */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.load-more-container .btn.pulse {
    animation: pulse 2s infinite;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .load-more-container .btn {
        min-width: 180px;
        padding: 16px 28px;
        font-size: 1rem;
    }
}

/* Filter Tabs Styles */
.filter-tabs {
    margin-bottom: 0.5rem;
    width: 100%;
}

/* Force horizontal tabs layout */
.filter-tabs .nav-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    border-bottom: none !important;
}

.filter-tabs .nav-tabs .nav-item {
    display: flex !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
}

.filter-tabs .nav-tabs .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    border-radius: 8px 8px 0 0 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    user-select: none !important;
    position: relative !important;
}

/* Prevent any dropdown behavior from Bootstrap */

/* Ensure no dropdown menus appear */
.filter-tabs .nav-tabs .dropdown-menu {
    display: none !important;
}

.filter-tabs .nav-tabs .nav-link:focus,
.filter-tabs .nav-tabs .nav-link:active {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

.filter-tabs .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 179, 0.1);
    border-color: #adb5bd;
    text-decoration: none;
}

.filter-tabs .nav-tabs .nav-link.active {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-tabs .nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* Desktop Layout Improvements */
@media (min-width: 769px) {
    .filter-search-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: clamp(16px, 4vw, 24px);
    }

    .filter-search-wrap {
        max-width: min(500px, 60vw);
        flex: 1;
    }

    .filter-clear {
        flex-shrink: 0;
        margin-left: auto;
    }

    .filter-count {
        flex-shrink: 0;
        margin-left: clamp(12px, 3vw, 20px);
        margin-right: 0;
    }
}

/* Override old filter styles - Hide old filter elements */
.course-filter-bar {
    display: none !important;
}

.filter-tabs-row .filter-tabs {
    display: none !important;
}

.nav-tabs {
    display: none !important;
}

.filter-search-row {
    display: none !important;
}

/* Ensure modern filter remains visible */
.modern-filter-container {
    display: block !important;
}
