/* --- Base & Variables --- */
*/ :root {
    --primary: #2563eb;
    --primary-dark2: #1e3a8a;
    --accent: #fbbf24;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 16px;
    --red: #ef4444;
    --transition: all 0.2s ease-out;
    /* Simplified transitions */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- TRUST STATS BAR --- */
.trust-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 100px;
    padding: 45px 5%;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.trust-stat {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.trust-stat:hover {
    transform: translateY(-3px);
}

.trust-icon {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.trust-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.trust-info h4 {
    font-size: 1.25rem;
    color: var(--primary-dark2);
    font-weight: 800;
    margin-bottom: 4px;
}

.trust-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}


/* --- NEW PREMIUM CONTROLS (SEARCH & FILTER) --- */
.controls-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 45px;
    padding: 16px 24px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* Modern Segmented Tab Look */
.filter-scroll-area {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px;
    background: #e2e8f0;
    border-radius: 14px;
    flex-grow: 1;
    max-width: fit-content;
}

.filter-scroll-area::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    outline: none;
}

.filter-btn:hover {
    color: #0f172a;
}

.filter-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Matched Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
}

.search-container input {
    width: 100%;
    padding: 14px 20px 14px 42px;
    border: none;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    background: transparent;
}

.search-container input::placeholder {
    color: #94a3b8;
}

/* --- Common Container & Grid --- */
.container {
    padding: 80px 5%;
    max-width: 1300px;
    margin: 0 auto;
}

.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    align-items: stretch;
    /* Forces equal height */
}

/* --- PREMIUM Pro-Style Course Cards (Equal Height Fix) --- */
.course-card-v2 {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    height: 100%;
    /* Take full grid cell height */
}

.course-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.course-card-v2 h3 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: #0f172a;
    border-bottom: 2px solid rgba(251, 191, 36, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: var(--transition);
}

.course-card-v2:hover .card-image-wrapper img {
    opacity: 1;
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 0;
    background: linear-gradient(135deg, #ea1386, #2651dc);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px 0 0 6px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    z-index: 2;
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 18px;
    line-height: 1.4;
}

.card-features {
    list-style: none;
    margin-bottom: 25px;
    flex: 1;
    /* Pushes the footer down to equalize heights */
}

.card-features li {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
}

.card-features i {
    color: #10b981;
    margin-top: 4px;
    font-size: 1.1rem;
}

.card-footer {
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price-wrap {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 0.9rem;
    color: #64748b;
    text-decoration: line-through;
    font-weight: 600;
}

.new-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-text {
    font-size: 0.75rem;
    color: #0f172a;
    background: #10b981;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
}

.enroll-btn {
    background: #fbbf24;
    color: #0f172a;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid #fbbf24;
}

.enroll-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    transform: scale(1.02);
}


/* =========================================================================
   --- HORIZONTAL CARD (Featured Item - Matched to Image Reference) --- 
========================================================================= */
.course-card-horizontal {
    display: flex;
    background: #0f172a;
    /* Solid dark color matching the reference image */
    border-radius: var(--radius, 16px);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    /* Spans exactly to the edges of the grid container */
    margin: 0 auto 50px auto;
    min-height: 280px;
    /* Increased height for better sync */
}

.course-card-horizontal:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.course-card-horizontal .card-image-wrapper {
    width: 42%;
    /* Wide image to match the provided proportion */
    max-width: 500px;
    height: auto;
    border-bottom: none;
    border-right: none;
    flex-shrink: 0;
}

.course-card-horizontal .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 35px 40px;
    /* Thicker padding to match design */
}

.horizontal-main {
    margin-bottom: 20px;
}

.course-card-horizontal .card-title {
    margin-bottom: 20px;
    font-size: 1.65rem;
    text-transform: uppercase;
    color: #ffffff;
    font-weight: 700;
}

/* 2-Column Grid for Features matching image */
.horizontal-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
    margin-bottom: 0;
}

.horizontal-features li {
    margin-bottom: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
    align-items: center;
    /* Aligns the icon beautifully */
}

.horizontal-footer {
    border-top: none;
    /* Removed line to exactly match reference image */
    padding-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Pin price block to bottom left */
}


/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .controls-wrapper {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
    }

    .filter-scroll-area {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .trust-bar {
        flex-direction: column;
        gap: 25px;
        text-align: center;
        padding: 35px 20px;
    }

    .trust-stat {
        flex-direction: column;
        gap: 12px;
    }

    .grid-wrapper {
        grid-template-columns: 1fr;
    }

    /* Revert horizontal card to stacked vertical on mobile */
    .course-card-horizontal {
        flex-direction: column;
        max-width: 100%;
    }

    .course-card-horizontal .card-image-wrapper {
        width: 100%;
        max-width: none;
        height: 220px;
    }

    .horizontal-features {
        grid-template-columns: 1fr;
        /* Stack features */
        gap: 12px;
    }

    .horizontal-footer {
        margin-top: 30px;
        align-items: center;
    }
}