/* Global Styles */
html, body {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Site Header */
.site-header {
    background-color: #2774AE; /* UCLA Blue */
    color: white;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    margin-right: 10px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Navbar */
.navbar {
    margin-left: auto;
    margin-right: 5%; /* Adds a right margin */
}

.navbar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.navbar ul li {
    display: inline;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.navbar ul li a:hover {
    text-decoration: underline;
}

/* Main Content */
main {
    margin-top: 80px; /* Space for the fixed header */
    text-align: center; /* Added here if needed globally */
}

.intro {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    color: #555;
}

.intro p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* App Buttons */
.app-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 40px 20px;
}

.app-card {
    background-color: white;
    width: 250px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.2s;
}

.app-card:hover {
    transform: translateY(-5px);
}

.app-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-top: 15px;
}

.app-card h3 {
    margin: 15px;
    font-size: 1.2rem;
    color: #2774AE;
}

.app-card p {
    margin: 0 15px 15px 15px;
    color: #555;
    font-size: 0.9rem;
}

/* Tables and Status Indicators */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
}

th {
    background-color: #2774AE; /* UCLA Blue */
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

.status-open {
    color: #388E3C;
    font-weight: bold;
}

.status-closed {
    color: crimson;
    font-weight: bold;
}

/* Footer */
.footer, footer {
    text-align: center;
    margin: 20px;
    font-size: 0.9rem;
    color: #555;
}

/* Responsive Styles */
@media only screen and (max-width: 768px) {
    .app-buttons {
        flex-direction: column;
        align-items: center;
    }
    .navbar {
        justify-content: flex-end;
        padding-right: 7%;
    }
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    table {
        width: 100%;
        table-layout: auto;
    }
    tr {
        margin: 0;
        padding: 10px;
    }
    td {
        display: block;
        padding: 13px;
        border: none;
        position: relative;
        padding-left: 50%;
        min-height: 30px;
    }
    td:before {
        position: absolute;
        top: 12px;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
    td:nth-of-type(1):before { content: "Library"; }
    td:nth-of-type(2):before { content: "Status"; }
    td:nth-of-type(3):before { content: "Today's Hours"; }
    /* Hide other columns on small screens */
    td:nth-of-type(n+4) {
        display: none;
    }
}

@media only screen and (orientation: landscape) and (max-height: 500px) {
    table {
        display: table; /* Ensure it's displayed as a table */
        width: 100%;
        font-size: 0.9rem; /* Slightly reduce font size for smaller devices */
    }
    th, td {
        padding: 8px 10px; /* Adjust padding for smaller heights */
        display: table-cell; /* Ensure proper table cell display */
    }
    tr {
        display: table-row; /* Ensure rows display properly */
    }
    thead {
        display: table-header-group; /* Re-enable the table headers */
    }
    td:before {
        display: none; /* Remove the labels before data */
    }
}

@media only screen and (min-width: 769px) {
    td:before {
        display: none;
    }
}
