@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* Glassmorphism Effect for certain elements */
.sh-glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Apply it to the entire body */
body, .main-inner, #page {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}


/* ============================================================
   SECTION 1: GLOBAL RESET & LAYOUT FOUNDATION
   ============================================================ */

/* Force Moodle to stay out of the way on StudentHub pages */
.studenthub-page #page,
.studenthub-page #page-content,
.studenthub-page #region-main,
.studenthub-page .bg-white,
.studenthub-page .container,
.studenthub-page .container-fluid {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide Moodle course secondary navigation on StudentHub pages */

.studenthub-page .secondary-navigation,
.studenthub-page .nav-tabs,
.studenthub-page .tabs-wrapper {
    display: none !important;
}

/* Base Wrapper */
.studenthub-page {
    max-width: 95%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* The Grid System (Reusable) 
   Uses Flexbox fallback for Bootstrap, but maintains grid logic */
.sh-grid {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

h1, h2, .sh-card-title {
    font-weight: 800;
    letter-spacing: -0.03em; /* Tight kerning for headers */
    color: var(--sh-primary);
}

/* ============================================================
   SECTION 2: REUSABLE COMPONENTS (The Library)
   ============================================================ */

/**
 * card-based element across all pages.
 */
.sh-card, .sh-course-card, .sh-enrolled-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;

    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06) !important;

    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.95),
        rgba(255,255,255,1)
    );

    box-shadow: 
        0 6px 18px rgba(0,0,0,0.06),
        0 2px 6px rgba(0,0,0,0.04);

    transition: 
        transform 0.35s cubic-bezier(.2,.8,.2,1),
        box-shadow 0.35s ease,
        border-color 0.25s ease;
}



/* PREMIUM HOVER */
.sh-card:hover, 
.sh-course-card:hover, 
.sh-enrolled-card:hover {

    transform: translateY(-6px) scale(1.01);

    border-color: var(--sh-primary) !important;

    box-shadow:
        0 14px 30px rgba(0,0,0,0.12),
        0 6px 12px rgba(0,0,0,0.08);
}



.sh-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(255,255,255,0.4),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.sh-card:hover::before {
    opacity: 1;
}


@keyframes sh-fade-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sh-card {
    animation: sh-fade-up 0.5s ease both;
}



/**
 * .sh-card-image-wrapper
 * Standardized image container to prevent stretching.
 */
.sh-card-image-wrapper, .sh-course-image-container, .sh-card-image-mini {
    width: 100%;
    overflow: hidden;
    position: relative;
}




.sh-card-img, .sh-hero-img, .sh-course-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.sh-card:hover .sh-card-img {
    transform: scale(1.05);
}


.sh-card-image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.05),
        rgba(0,0,0,0.15)
    );
}



/**
 * .sh-card-body 
 * Reusable body padding and flex-alignment
 */
.sh-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/**
 * .sh-card-actions / footer
 * Reusable action bar at bottom of cards
 */
.sh-card-actions, .sh-card-footer {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

/**
 * .sh-badge 
 * Reusable pill logic
 */
.sh-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 2;
}




/* ============================================================
   SECTION 3: PAGE-SPECIFIC STYLES
   ============================================================ */



/* ======== CARD BODY FLEX FLOW ======== */
.sh-course-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem !important; /* enough padding for content */
    height: auto !important; /* remove fixed height */
}

/* ======== DETAILS FOOTER + DIVIDER ======== */
.sh-details-footer {
    margin-bottom: 0.5rem !important;
}


.sh-card-actions {
    margin-bottom: 1rem !important;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

.sh-card-divider {
    position: relative !important; /* remove absolute positioning */
    bottom: auto !important;
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top:auto;
    margin-bottom: 0.5rem; /* small spacing above buttons */
    opacity: 1;
}


/* ======== REMOVE UNUSED WRAPPERS ======== */
.sh-card-top-content,
.sh-card-footer {
    display: block; /* remove flex magic if present */
    flex-grow: 0 !important;
    margin: 0;
    padding: 0;
}


/* --- CUSTOM EXPANSION CONTAINER --- */

@media (min-width: 1200px) {
    .sh-browser-expansion {
        /* This forces the container to be wider than Moodle's layout */
        width: 90vw !important; 
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -45vw !important; /* Half of the width to keep it centered */
        margin-right: -45vw !important;
    }

    /* Ensure the internal fluid container utilizes the new space */
    .sh-browser-expansion .container-fluid {
        max-width: 100% !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    /* Make sure cards adjust to the new wide space */
    #course-results .col-lg-4 {
        /* On ultra-wide screens, you might even want 4 cards instead of 3 */
        /* Change col-lg-4 to col-xl-3 in your courses_ajax.php if you want 4 per row */
    }
}


/* Clear out any inherited Moodle padding that might be squeezing the content */
.studenthub-page #region-main,
.studenthub-page .card-body {
    padding: 0 !important;
}


.sh-course-card.sh-enrolled {
    background: linear-gradient(
        180deg,
        rgba(25, 135, 84, 0.04),
        rgba(25, 135, 84, 0.02)
    );
}

.sh-enrolled-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.6em;
    border-radius: 999px;
    background-color: rgba(25, 135, 84, 0.12);
    color: #198754;
    letter-spacing: 0.02em;
}


 .sh-enrolled-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    padding: 1.5rem 1.5rem 2.5rem; /* more space at bottom */
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sh-enrolled-card:hover  {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
}

.sh-btn-action {
    align-self: center;
    padding: 0.6rem 1.8rem;
    border-radius: 50px; /* premium pill */
    font-weight: 600;
    min-width: 80%;
    max-width: 90%;
    margin-top: 1rem;

    background: linear-gradient(
        135deg,
        var(--sh-primary),
        color-mix(in srgb, var(--sh-primary) 70%, #ffffff 30%)
    );

    color: #fff;

    box-shadow:
        0 6px 16px rgba(0,0,0,0.12);

    transition: all 0.3s ease;
    border: none;
}

.sh-btn-action:hover {
    transform: translateY(-2px) scale(1.02);

    background: linear-gradient(
        135deg,
        var(--sh-secondary),
        color-mix(in srgb, var(--sh-secondary) 70%, #ffffff 30%)
    );

    box-shadow:
        0 10px 24px rgba(0,0,0,0.18);
}



.sh-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    background: #ff9900;
}

/* Card Titles & Descriptions */
.sh-card-title{
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.sh-card-desc {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: #6c757d;
}




/* ============================================================
   StudentHub Table Card
============================================================ */
.sh-table-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

.sh-table-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.sh-table-card .table thead {
    background: linear-gradient(
        135deg,
        var(--sh-primary),
        var(--sh-secondary)
    );
    color: #fff;
    font-weight: 600;
}


.sh-table-card .table th,
.sh-table-card .table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}


/* Optional hover for rows */
.sh-table-card .table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transition: background 0.3s ease;
}








/* ============================================================
   SECTION 4: RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .sh-course-image-container { height: 250px; }
    .studenthub-page { padding: 1rem 0.5rem; }
    
    #sh-course-browser .sh-filter-card {
        border-radius: 15px !important; /* Square it on mobile */
        padding: 10px !important;
    }
    
    .sh-select-item {
        border: 1px solid #eee !important; /* The light border you requested */
        border-radius: 8px !important;
        margin: 4px 0;
        background-color: #f9f9f9 !important;
    }
    
    /* Make sure the nested row doesn't add extra space */
    #sh-course-browser .sh-filter-card .row {
        margin: 0 !important;
    }
}





