/* Global styles */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
    box-sizing: border-box; /* Ensure consistent sizing */
}

::-webkit-scrollbar-thumb {
    background-color: #cac5d35d;
    border-radius: 6px;
}

::-webkit-scrollbar-track {
    background-color: #f4f4f4;
}

/* Program title styling */
.h1 {
    margin-top: 100px !important; /* Added margin to push the title down */
    font-size: 2rem;
    font-weight: bold;
    color: #4b0082; /* Adjusted color for consistency */
}

/* Search bar styling */
.form-control {
    border: 1px solid #4b0082; /* Purple border for the search bar */
    border-radius: 5px; /* Optional: rounded corners */
    box-shadow: none; /* Remove default shadow */
}

.form-control:focus {
    border-color: #4b0082; /* Purple outline when focused */
    box-shadow: 0 0 5px #4b0082; /* Subtle purple glow on focus */
    outline: none; /* Remove default outline */
}

/* Image styling for programs */
.program-image {
    border: 1.5px solid #744eb9; /* Optional border for aesthetics */
    border-radius: 5px; /* Rounded corners */
    width: 100%;
    max-width: 570px; /* Maximum width of the image container */
    height: 320px; /* Fixed height for uniformity */
    object-fit: cover; /* Crop the image to completely fill the container */
    object-position: center; /* Center the image within the container */
    margin: 0 auto 10px; /* Center-align the image and add spacing below */
    background-color: #f8f8f8; /* Optional background color for contrast */
}

/* Placeholder for programs without images */
.default-placeholder {
    background-color: #f0f0f0;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: 2px solid #ccc;
    border-radius: 5px;
    margin: 0 auto 10px;
    text-align: center;
}

h5 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #3182ce;
    text-align: center;
    margin-top: 5px; /* Reduced margin to bring the title closer to the image */
    margin-bottom: 0; /* Remove unnecessary space below */
    white-space: normal; /* Allow text to wrap if too long */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add ellipsis for truncated text */
    word-wrap: break-word; /* Ensure long words break properly */
}

/* Row container spacing */
.row-cols-1, .row-cols-md-2 {
    row-gap: 20px; /* Add space between rows */
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    /* Move the Program title down for mobile */
    .h1 {
        margin-top: 150px !important; /* Increased margin for mobile view */
        font-size: 1.5rem; /* Smaller font size for mobile for better scaling */
    }

    /* Stack the program items for mobile screens */
    .row-cols-1 {
        column-count: 1; /* Force a single column for small screens */
    }

    /* Adjust image size for mobile screens */
    .program-image {
        height: 250px; /* Reduced height for mobile */
    }

    /* Adjust program title font size for mobile */
    h5 {
        font-size: 1rem; /* Smaller font size for program title */
    }

    /* Mobile-friendly padding and spacing */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Make sure the programs list is not too wide */
    .program-list {
        width: 100%;
    }
}

@media (max-width: 767px) {
    /* Adjust search bar height for mobile */
    .form-control {
        border: 1px solid #4b0082; /* Purple border for consistency */
        border-radius: 5px 0 0 5px; /* Rounded corners only on the left */
        box-shadow: none; /* Remove default shadow */
        height: 45px; /* Ensure consistent height */
    }

    .form-control:focus {
        border-color: #4b0082; /* Purple outline when focused */
        box-shadow: 0 0 5px #4b0082; /* Subtle purple glow on focus */
        outline: none; /* Remove default outline */
    }

    /* Adjust search icon button height for mobile */
    .btn-outline-primary {
        border: 1px solid #4b0082; /* Match border color of search bar */
        border-radius: 0 5px 5px 0; /* Rounded corners only on the right */
        height: 45px; /* Match the height of the search bar */
        padding: 0 12px; /* Adjust padding for alignment */
        display: flex;
        align-items: center;
        justify-content: center; /* Center the icon inside the button */
        box-shadow: none; /* Remove default shadow */
    }

    .btn-outline-primary:hover {
        background-color: #4b0082; /* Add hover effect */
        color: #fff; /* White text on hover */
    }
}