* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html, body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

#loadingAnim{

    font-family: monospace;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.footer {
    background-color: #000;
    padding: 1rem 0;
    text-align: center;
    color: #ffffff;
    width: 100%;
    margin-top: auto;
}

.navbar {
    background-color: #000;
    color: white;
    height: 60px;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 500;
    white-space: nowrap;
}

.view-counter {
    font-size: 1.2rem;
}


.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 500;
    color: #333;
}

select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;

    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

button {
    background-color: #000;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: fit-content;
}

button:hover {
    background-color: #333;
}

#timetableDisplay {
    margin-top: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    width: 100%;
}

#roomsDisplay{
    margin-top: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

#timetableDisplay thead {
    background-color: #000;
    color: #fff;
    text-align: left;
    font-size: 1.1rem;
}

.timetable-table {

    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
    table-layout: fixed;
}

.timetable-table th,
.timetable-table td {
    padding: 1rem;
    text-align: left;
    
    border-bottom: 1px solid #ddd;
    white-space: normal;
    word-wrap: break-word;
}

.timetable-table th {
    font-weight: 600;
}

.timetable-table tr:last-child td {
    border-bottom: none;
}

.timetable-table tr:not(:has(th)):hover {
    background-color: #f8f8f8;
}

.strikethrough {
    text-decoration: line-through;
    color: #888;
}

.contact-info {
    margin-top: 0.5rem;
    font-size: 1rem;
}

.contact-info a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease-in-out;
}

.contact-info a:hover {
    color: #d8d7d7;
    text-decoration: underline;
}

.contact-info span {
    margin: 0 0.5rem;
    color: #ffffff;
}

@media (min-width: 768px) {
    .navbar {
        justify-content: center;
        position: relative;
        background-color: #000;
        color: white;
        padding: 1rem 2rem;
        height: 60px;
    }

    .navbar-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .view-counter {
        position: absolute;
        right: 2rem;
    }
}

@media (max-width: 768px) {
    
    .container {
        padding: 0 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    #timetableDisplay {
        margin: 2rem -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
    }

    .timetable-table {
        table-layout: auto;
    }

    .timetable-table th,
    .timetable-table td {
        min-width: 120px;
        padding: 0.75rem;
    }

    
    #timetableDisplay {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    
    .timetable-table {
        margin: 0;
        width: 100%;
    }

    
    .timetable-table th:nth-child(1),
    .timetable-table td:nth-child(1) {
        width: 40%;
    }

    .timetable-table th:nth-child(2),
    .timetable-table td:nth-child(2) {
        width: 35%;
    }

    .timetable-table th:nth-child(3),
    .timetable-table td:nth-child(3) {
        width: 25%;
    }
}

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    right: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
  }
  
  .sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #818181;
    display: block;
  }
  
  .sidenav a:hover {
    color: #f1f1f1;
  }
  
  .sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
  }
  
  @media screen and (max-height: 450px) {
    .sidenav {padding-top: 15px;}
    .sidenav a {font-size: 18px;}
  }

  .rooms-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.rooms-table thead {
    background-color: #000;
    color: #fff;
    text-align: left;
    font-size: 1.1rem;
}

.rooms-table th, .rooms-table td {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.rooms-table tbody tr:hover {
    background-color: #f8f8f8;
}

.rooms-table th {
    font-weight: 600;
}

.rooms-table td {
    font-size: 1rem;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loading-container .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-width: 4px;
    border-top-color: #333;
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}