﻿/* General page styling */
.gridtitle {
    text-align: center;
    color: #003571;
    background-color: #e6eef5;
    padding: 15px;
    border-radius: 5px;
    margin: 0 auto 20px;
    max-width: 1200px;
    font-weight: bold;
}
.applybtn {
    color: #0089c9;
    border-color: #0089c9;
    background-color: transparent;
}
    .applybtn:hover {
        color:white!important;
     
        background-color: #0089c9;
    }

/* === Desktop/Tablet Layout using CSS Grid === */
.schedule-grid {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    /* Modified column widths for better alignment */
    grid-template-columns: minmax(200px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(80px, 1fr) minmax(150px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 120px;
    grid-gap: 1px;
    background-color: #ddd;
}

/* A new div to wrap all cells in a row */
.grid-row {
    display: contents;
}

.header-cell, .grid-cell {
    padding: 12px 15px;
    white-space: nowrap;
    text-align: left;
  
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header cells styling */
.header-cell {
    background-color: #003571;
    color: white;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

    .header-cell:hover {
        background-color: #0089c9;
    }

/* Data cells styling */
.grid-cell {
    background-color: #f9f9f9;
    transition: background-color 0.3s ease;
}

.grid-row:nth-of-type(even) .grid-cell {
    background-color: #f1f1f1;
}

.grid-row:nth-of-type(odd) .grid-cell {
    background-color: #f9f9f9;
}

.grid-row:hover .grid-cell {
    background-color: #e6eef5;
}

/* Course Title Link styling */
.course-link {
    color: #004b8e;
    text-decoration: none;
    font-weight: bold;
}

    .course-link:hover {
        text-decoration: underline;
    }

/* Styling for icons */
.grid-cell i {
    margin-right: 8px;
    color: #003571;
}

/* Register button styling */
.register-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 15px;
    background-color: #0089c9;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

    .register-btn:hover {
        background-color: #007bb3;
    }

    .register-btn .fa-arrow-right {
        margin-left: 8px;
        color:white;
    }

.register-cell {
    padding: 8px 15px;
}

/* === Mobile Layout using a Media Query === */
@media screen and (max-width: 768px) {
     .register-cell::before {
        content: "";
    }
    .schedule-grid {
        display: flex;
        flex-direction: column;
        grid-gap: 0;
        box-shadow: none;
        background-color: transparent;
    }

    .header-cell {
        display: none;
    }

    .grid-row {
        display: flex;
        flex-direction: column;
        border: 1px solid #ddd;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        background-color: #fff;
    }

    .grid-cell {
        display: grid;
        grid-template-columns: 140px 1fr; /* Fixed label width */
        column-gap: 10px;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
        background-color: transparent;
        white-space: normal;
    }

    .grid-row:nth-of-type(even) .grid-cell,
    .grid-row:nth-of-type(odd) .grid-cell {
        background-color: transparent;
    }

    .grid-cell:last-child {
        border-bottom: none;
    }

    .grid-cell::before {
        content: attr(data-label);
        font-weight: bold;
        color: #003571;
        text-align: left;
        white-space: nowrap;
    }

    .register-cell {
        order: 99;
        padding: 15px;
        border-top: 1px solid #eee;
        border-bottom: none;
        display: grid;
        grid-template-columns: 190px 1fr;
        align-items: center;
        white-space: normal;
    }

        .register-cell::before {
            content: " ";
            font-weight: bold;
            color: #003571;
            text-align: left;
        }

    .register-btn {
        width: auto;
        justify-self: flex-start;
        text-align: left;
    }

    .grid-cell > * {
        justify-self: start;
        text-align: left;
    }

    .course-link {
        justify-self: start;
    }
}
