/* --- COURSES.HTML STYLES --- */

/* 1. HERO SECTION */
.course-hero {
    background: #f8fafc;
    padding: 120px 0;
    border-bottom: 1px solid #e2e8f0;
}

.course-hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content { max-width: 600px; }
.hero-content h1 { font-size: 3.5rem; color: #0f172a; font-weight: 800; line-height: 1.1; margin: 15px 0; }
.hero-content p { color: #64748b; font-size: 1.1rem; margin-bottom: 30px; }

.badge-pill-blue {
    background: rgba(56, 189, 248, 0.1);
    color: #0284c7;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hero-search {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 50px;
    padding: 8px 8px 8px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 500px;
}
.hero-search input {
    border: none; outline: none; flex: 1; font-size: 1rem; color: #0f172a;
}
.hero-search button {
    background: #0f172a; color: #fff; border: none; padding: 12px 25px; border-radius: 50px; cursor: pointer; font-weight: 600;
}
.hero-search button:hover { background: #38bdf8; }

.hero-visual img {
    border-radius: 20px;
    box-shadow: 20px 20px 0px rgba(56, 189, 248, 0.1);
    width: 100%;
    max-width: 500px;
}

/* 2. STICKY FILTER BAR */
.filter-bar-sticky {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.filter-flex { display: flex; justify-content: space-between; align-items: center; }

.filter-group { display: flex; gap: 15px; align-items: center; }
.filter-label { font-weight: 700; color: #0f172a; font-size: 0.9rem; }

.filter-select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
}
.filter-select:hover { border-color: #38bdf8; }

.view-toggle span { color: #94a3b8; font-size: 0.9rem; font-weight: 600; }

/* 3. SCROLLABLE COURSE RAILS */
.course-section { padding: 60px 0; background: #fff; }

.rail-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px;
}
.rail-header h3 { font-size: 1.5rem; color: #0f172a; font-weight: 800; }
.mt-large { margin-top: 60px; }

.scroll-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    transition: 0.2s;
}
.scroll-btn:hover { background: #0f172a; color: #fff; }

.course-rail {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 30px;
    scroll-behavior: smooth;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.course-rail::-webkit-scrollbar { display: none; }

.rail-wrapper {
    position: relative;
    margin: 0 -15px;
    padding: 0 15px;
}

/* 4. COURSE CARD DESIGN */
.course-card {
    min-width: 300px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s ease;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.level-tag {
    position: absolute;
    top: 15px; left: 15px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.beginner { background: #22c55e; }
.intermediate { background: #f59e0b; }
.advanced { background: #ef4444; }

.card-body { padding: 20px; }

.tech-icon {
    width: 40px; height: 40px;
    background: #f8fafc;
    color: #38bdf8;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

.course-card h4 { font-size: 1.1rem; color: #0f172a; font-weight: 700; margin-bottom: 5px; line-height: 1.4; }
.instructor { color: #64748b; font-size: 0.85rem; margin-bottom: 15px; }

.rating { color: #f59e0b; font-size: 0.9rem; margin-bottom: 20px; font-weight: 700; }
.reviews { color: #94a3b8; font-weight: 400; font-size: 0.8rem; margin-left: 5px; }

.card-meta {
    display: flex; justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

/* SCROLL ARROWS */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: #0f172a;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s ease;
    visibility: hidden;
}

.left-arrow { left: 0px; }
.right-arrow { right: 0px; }

.rail-wrapper:hover .scroll-arrow {
    opacity: 1;
    visibility: visible;
}

.scroll-arrow:hover {
    background: #0f172a;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    border-color: #0f172a;
}

/* 5. STUDENT SUCCESS SECTION */
.outcomes-section {
    background-color: #f1f5f9;
    padding: 100px 0;
    color: #0f172a;
    position: relative;
    border-top: 1px solid #e2e8f0;
}

.outcomes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.outcomes-left h2 { 
    font-size: 3rem; 
    color: #0f172a; 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 20px; 
}

.outcomes-left .text-white { color: #0ea5e9; }

.section-sub { 
    color: #64748b; 
    font-size: 1.1rem; 
    margin-bottom: 40px; 
    max-width: 450px; 
}

.badge-pill-gold {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706; 
    padding: 6px 14px; 
    border-radius: 50px;
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    display: inline-block; margin-bottom: 20px;
}

.review-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}
.review-card:hover { 
    transform: translateX(10px); 
    border-color: #0ea5e9; 
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); 
}

.review-header { display: flex; gap: 15px; align-items: center; margin-bottom: 15px; }
.review-header img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 1px solid #e2e8f0; }
.review-header div h4 { color: #0f172a; font-weight: 700; margin: 0; }
.review-header div span { color: #64748b; font-size: 0.8rem; }
.company-logo { margin-left: auto; color: #0ea5e9; font-size: 1.2rem; }
.review-card p { color: #475569; font-style: italic; line-height: 1.6; }

.outcomes-right { display: flex; justify-content: center; }

.cert-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 40px;
    border-radius: 20px;
    position: relative;
    max-width: 450px; width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    color: #fff;
    text-align: center;
}

.cert-content { position: relative; z-index: 2; }
.cert-header { color: #fbbf24; margin-bottom: 20px; }
.cert-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.cert-header h5 { font-size: 0.8rem; letter-spacing: 2px; margin: 0; }

.cert-box h3 { font-size: 2rem; color: #fff; margin-bottom: 10px; font-family: 'Times New Roman', serif; }
.cert-id { 
    background: rgba(255,255,255,0.1); 
    display: inline-block; padding: 5px 15px; 
    border-radius: 4px; font-family: monospace; 
    color: #cbd5e1; font-size: 0.9rem; margin-bottom: 20px; 
}
.cert-box p { color: #94a3b8; font-size: 0.9rem; line-height: 1.6; margin-bottom: 30px; }

.cert-footer { 
    display: flex; justify-content: center; gap: 20px; 
    border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; 
}
.cert-footer span { font-size: 0.8rem; color: #cbd5e1; display: flex; align-items: center; gap: 8px; }
.cert-footer i { color: #fbbf24; }

.cert-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 120%; height: 120%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: 1; pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .course-hero .container { flex-direction: column; text-align: center; }
    .hero-search { margin: 0 auto; }
    .hero-visual { display: none; }
    .filter-flex { flex-direction: column; gap: 15px; align-items: flex-start; }
    .outcomes-grid { grid-template-columns: 1fr; }
    .outcomes-left h2 { font-size: 2.2rem; }
    .section-sub { max-width: 100%; }
}

@media (max-width: 768px) {
    .filter-list { overflow-x: auto; width: 100%; padding-bottom: 10px; }
    .scroll-arrow { display: none; }
}

/* =========================================
   COURSES PAGE RESPONSIVE FIXES
   ========================================= */

@media (max-width: 900px) {

    /* --- 1. HERO SECTION --- */
    .course-hero {
        padding: 60px 0; /* Reduce padding */
        text-align: center;
    }

    .course-hero .container {
        flex-direction: column;
        gap: 30px;
    }

    .hero-content h1 {
        font-size: 2.5rem; /* Smaller heading */
    }

    .hero-search {
        margin: 0 auto; /* Center search bar */
        width: 100%;
    }

    .hero-visual {
        display: none; /* Hide image on mobile to save space */
    }

    /* --- 2. FILTER BAR --- */
    .filter-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap; /* Allow filters to wrap */
        gap: 10px;
    }

    .filter-select {
        flex: 1; /* Make dropdowns full width */
        min-width: 140px;
    }

    /* --- 3. COURSE RAILS (The "More than 2 boxes" Fix) --- */
    .rail-header {
        margin-bottom: 15px;
    }
    
    .rail-header h3 {
        font-size: 1.2rem;
    }

    .rail-wrapper {
        margin: 0 -15px; /* Pull to edge of screen */
        padding: 0 15px;
    }

    .course-rail {
        gap: 12px; /* Tighter gap between cards */
        padding-bottom: 20px;
        padding-right: 20px; /* Ensure last card isn't cut off */
    }

    /* HIDE SCROLL ARROWS ON MOBILE (User will swipe) */
    .scroll-arrow {
        display: none !important;
    }

    /* COMPACT CARD STYLING */
    .course-card {
        /* 160px width allows ~2.3 cards on a standard iPhone screen */
        min-width: 170px !important; 
        max-width: 170px;
        border-radius: 10px;
    }

    .card-thumb {
        height: 100px; /* Shorter image */
    }

    .level-tag {
        font-size: 0.6rem;
        padding: 3px 8px;
        top: 8px; left: 8px;
    }

    .card-body {
        padding: 12px; /* Less padding */
    }

    .tech-icon {
        width: 30px; height: 30px; /* Smaller icon */
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .course-card h4 {
        font-size: 0.85rem; /* Smaller Title */
        margin-bottom: 3px;
        line-height: 1.3;
        /* Limit title to 2 lines */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .instructor {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .rating {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    /* --- 4. OUTCOMES SECTION --- */
    .outcomes-grid {
        grid-template-columns: 1fr; /* Stack vertical */
        gap: 40px;
    }

    .outcomes-left h2 {
        font-size: 2.2rem;
    }

    .cert-box {
        margin: 0 auto; /* Center certification */
        padding: 25px;
    }

    .cert-box h3 {
        font-size: 1.5rem;
    }
}

/* =========================================
   FILTER BAR RESPONSIVE FIX
   ========================================= */

@media (max-width: 900px) {

    
    .filter-bar-sticky {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    
    /* CHANGED: Removed 'position: sticky' and 'top: 0' */
    position: relative; 
    z-index: 10; /* Lower z-index since it doesn't need to float over things */
    box-shadow: none; /* Optional: Remove shadow if it's not floating */
}

    .filter-flex {
        flex-direction: column; /* Stack elements vertically */
        align-items: stretch; /* Make them full width */
        gap: 12px;
    }

    /* 1. Organize the Filter Inputs */
    .filter-group {
        display: flex;
        flex-wrap: wrap; /* Allow wrapping */
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .filter-label {
        width: 100%; /* Force label to its own line */
        font-size: 0.85rem;
        margin-bottom: 2px;
        color: #64748b;
    }

    .filter-select {
        flex: 1; /* Dropdowns share width equally (50% / 50%) */
        min-width: 0; /* Prevent overflow */
        height: 45px; /* Tappable height */
    }

    /* 2. Fix the "Showing Courses" Text */
    .view-toggle {
        text-align: center; /* Center the text */
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid #f1f5f9; /* Subtle separator line */
    }

    .view-toggle span {
        font-size: 0.8rem;
    }

    .view-toggle:last-of-type { 
        display: none; 
    }
}
/* =========================================
   HERO SECTION RESPONSIVE FIX
   ========================================= */

@media (max-width: 900px) {

    .course-hero {
        padding: 60px 0 40px; /* Reduce top/bottom padding */
        text-align: center; /* Center align text */
    }

    .course-hero .container {
        flex-direction: column; /* Stack elements vertically */
        gap: 30px;
    }

    .hero-content {
        max-width: 100%; /* Use full width */
        padding: 0 15px; /* Add side padding */
    }

    .hero-content h1 {
        font-size: 2.2rem; /* Smaller, readable title */
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 25px;
        color: #64748b;
    }

    /* =========================================
   FIX SEARCH BAR CAUSING SCROLL (Mobile)
   ========================================= */

@media (max-width: 900px) {

    /* 1. Constraint the Container */
    .hero-search {
        width: 100%;
        max-width: 100%; /* Ensure it never exceeds screen width */
        margin: 0 auto;
        padding: 6px 6px 6px 15px; /* Reduce padding to save space */
        gap: 10px; /* Reduce gap between elements */
        box-sizing: border-box; /* Include padding in width calculation */
    }

    /* 2. CRITICAL FIX: Allow Input to Shrink */
    /* By default, inputs won't shrink below their placeholder text length. 
       min-width: 0 forces it to shrink and cut off text if needed. */
    .hero-search input {
        min-width: 0; 
        flex: 1; /* Take up remaining space */
        width: 100%; 
        font-size: 0.9rem; /* Prevent iOS zoom */
    }

    /* 3. Compact the Button */
    .hero-search button {
        padding: 10px 16px; /* Smaller button padding */
        font-size: 0.85rem;
        white-space: nowrap; /* Prevent "Search" from wrapping */
        flex-shrink: 0; /* Ensure button doesn't get crushed */
    }

    /* 4. Adjust the Search Icon */
    .hero-search i {
        font-size: 0.9rem;
        flex-shrink: 0;
    }
}
    /* Hide the visual on mobile to keep the search bar visible immediately */
    .hero-visual {
        display: none; 
    }
}

/* =========================================
   OUTCOMES SECTION: SIDE-BY-SIDE MOBILE FIX
   ========================================= */

@media (max-width: 900px) {

    /* 1. Force 2 Columns (Side-by-Side) */
    .outcomes-grid {
        grid-template-columns: 1fr 1fr !important; /* Split 50/50 */
        gap: 15px; /* Tighter gap */
        align-items: center; /* Vertically center the content */
    }

    /* --- LEFT COLUMN (Text & Reviews) --- */
    .outcomes-left {
        min-width: 0; /* Prevent overflow */
    }

    .outcomes-left h2 {
        font-size: 1.3rem; /* Smaller Headline */
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .section-sub {
        font-size: 0.75rem; /* Tiny description */
        margin-bottom: 15px;
        line-height: 1.3;
    }

    .badge-pill-gold {
        font-size: 0.6rem;
        padding: 3px 8px;
        margin-bottom: 10px;
    }

    /* Compact Review Cards */
    .review-card {
        padding: 10px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .review-header {
        gap: 8px;
        margin-bottom: 8px;
    }

    .review-header img {
        width: 25px; height: 25px; /* Tiny Avatar */
    }

    .review-header div h4 {
        font-size: 0.7rem; /* Tiny Name */
    }

    .review-header div span {
        font-size: 0.55rem; /* Tiny Role */
        display: block; /* Ensure it wraps */
    }

    .company-logo {
        font-size: 0.8rem;
    }

    .review-card p {
        font-size: 0.6rem; /* Tiny Review Text */
        line-height: 1.3;
    }

    /* --- RIGHT COLUMN (Certificate) --- */
    .outcomes-right {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .cert-box {
        padding: 15px 10px; /* Very tight padding */
        width: 100%;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .cert-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .cert-header h5 {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }

    .cert-box h3 {
        font-size: 1rem; /* Smaller Cert Title */
        margin-bottom: 8px;
        line-height: 1.1;
    }

    .cert-id {
        font-size: 0.6rem;
        padding: 3px 8px;
        margin-bottom: 10px;
    }

    .cert-box p {
        font-size: 0.6rem;
        line-height: 1.2;
        margin-bottom: 10px;
        display: none; /* Optional: Hide description to save space if needed */
    }

    .cert-footer {
        flex-direction: column; /* Stack the footer items vertically */
        gap: 5px;
        padding-top: 10px;
    }

    .cert-footer span {
        font-size: 0.55rem;
        justify-content: center;
    }
}