@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --csu-accent: #00a5cf; /* Teal/Cyan brand color from "Inquire Now" button */
    --csu-accent-dark: #0077b6;
    --csu-text-dark: #0f172a;
    --csu-text-light: #64748b;
    --csu-border-color: #e2e8f0;
    --csu-card-bg-fallback: #1e293b;
    --csu-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* App Wrapper */
.csu-courses-app-container {
    font-family: var(--csu-font-family);
    color: var(--csu-text-dark);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.csu-courses-app-container * {
    box-sizing: border-box;
}

/* Search Section */
.csu-search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.csu-search-box-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.csu-search-input {
    width: 100%;
    height: 52px;
    padding: 10px 50px 10px 24px;
    font-size: 16px;
    font-family: var(--csu-font-family);
    border: 1px solid var(--csu-border-color);
    border-radius: 30px;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    outline: none;
    transition: all 0.3s ease;
}

.csu-search-input:focus {
    border-color: var(--csu-accent);
    box-shadow: 0 4px 20px rgba(0, 165, 207, 0.15);
}

.csu-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--csu-text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.csu-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--csu-text-light);
    transition: stroke 0.3s ease;
}

.csu-search-input:focus + .csu-search-icon svg {
    stroke: var(--csu-accent);
}

/* Main Layout */
.csu-layout-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
    width: 100%;
}

/* Sidebar Filters */
.csu-sidebar-filters {
    position: sticky;
    top: 20px;
    background: #ffffff;
    padding: 10px 0;
}

/* Results Count Text */
.csu-results-count-container {
    margin-bottom: 20px;
}

.csu-results-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--csu-text-light);
    line-height: 1.6;
    display: inline-block;
}

/* Filter Header (Filter Title + Clear) */
.csu-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--csu-border-color);
    margin-bottom: 20px;
}

.csu-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--csu-text-dark);
}

.csu-clear-button {
    background: none;
    border: none;
    color: #e60023; /* Classic red for clearing filters */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: var(--csu-font-family);
    transition: opacity 0.2s ease;
}

.csu-clear-button:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Filter Group */
.csu-filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--csu-border-color);
    padding-bottom: 20px;
}

.csu-filter-group:last-of-type {
    border-bottom: none;
}

.csu-filter-group-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--csu-text-dark);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csu-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.csu-filter-item {
    margin-bottom: 12px;
}

.csu-filter-item:last-child {
    margin-bottom: 0;
}

/* Checkbox Labels */
.csu-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: #475569;
    user-select: none;
    line-height: 1.4;
}

.csu-checkbox-label input {
    display: none;
}

/* Custom Checkbox Design */
.csu-checkbox-custom {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid #a0aec0;
    border-radius: 2px;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

/* Checkbox Checked State: Black Filled Square */
.csu-checkbox-label input:checked + .csu-checkbox-custom {
    background-color: #000000;
    border-color: #000000;
}

/* Checkbox Checkmark (White dot/check in the center, or just filled black block. Let's make it a nice white checkmark inside the black box for premium clarity) */
.csu-checkbox-label input:checked + .csu-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 5px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.csu-checkbox-text {
    transition: color 0.2s ease;
}

.csu-checkbox-label:hover .csu-checkbox-text {
    color: #000000;
}

.csu-checkbox-label:hover .csu-checkbox-custom {
    border-color: #000000;
}

/* Course Grid */
.csu-courses-grid-wrapper {
    width: 100%;
}

.csu-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    min-height: 200px;
}

.csu-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px dashed var(--csu-border-color);
}

.csu-no-results p {
    font-size: 16px;
    color: var(--csu-text-light);
    margin: 0;
}

/* Course Card (Premium overlay design) */
.csu-course-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 360px;
    max-width: 100%;
    border-radius: 0 24px 0 24px;
    overflow: hidden;
    text-decoration: none;
    background-color: var(--csu-card-bg-fallback);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    animation: csuFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes csuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Background Image Container */
.csu-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

/* Image zoom on hover */
.csu-course-card:hover .csu-card-bg {
    transform: scale(1.08);
}

/* Card translation and shadow on hover */
.csu-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Gradient Overlay: dark at bottom for legibility */
.csu-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 2;
    transition: background 0.4s ease;
}

.csu-course-card:hover .csu-card-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0.5) 55%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

/* Card Content Details */
.csu-card-content {
    position: relative;
    z-index: 3;
    padding: 16px 20px;
    width: 100%;
    background-color: #003161; /* Solid Navy Blue background behind text */
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.csu-course-card:hover .csu-card-content {
    background-color: #00407a; /* Lighter navy/blue on hover */
}

/* Course Title */
.csu-course-title {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.35;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Course Metadata (e.g. Undergraduate Level | Faculty of Computing) */
.csu-course-meta {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Rules */
@media (max-width: 992px) {
    .csu-layout-container {
        grid-template-columns: 240px 1fr;
        gap: 30px;
    }
    .csu-courses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .csu-layout-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .csu-sidebar-filters {
        position: relative;
        top: 0;
        border-bottom: 1px solid var(--csu-border-color);
        padding-bottom: 20px;
        margin-bottom: 10px;
    }
    
    .csu-courses-grid {
        grid-template-columns: 1fr;
    }
    
    .csu-course-card {
        min-height: 380px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .csu-courses-grid {
        grid-template-columns: 1fr;
    }
    
    .csu-course-card {
        min-height: 340px;
        max-width: 100%;
    }
    
    .csu-course-title {
        font-size: 18px;
    }
}
