/* Existing .login-page and .slots-page styles remain unchanged above this */

/* Timetable page styles */
.timetable-page {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.timetable-page .container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.timetable-page h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.timetable-page .controls {
    text-align: right;
    margin-bottom: 20px;
}

.timetable-page .controls button {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.timetable-page .controls button:hover {
    background: #218838;
    transform: scale(1.05);
}

.timetable-page .controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.timetable-page #timetableContent {
    margin: 0;
    padding: 0;
    overflow: visible; /* Ensure no clipping */
    width: 100%;
}

.timetable-page #timetableContent h2 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    text-transform: uppercase;
}

.timetable-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid #000;
}

.timetable-page th, .timetable-page td {
    padding: 8px;
    text-align: center;
    border: 1px solid #000;
}

.timetable-page th {
    background: transparent;
    color: #000;
    font-weight: normal;
}

.timetable-page td {
    background: transparent;
}

.timetable-page .timetable-cell:hover {
    background: #e9f1ff;
    cursor: pointer;
}

.timetable-page tr.fade-in {
    animation: fadeInRow 0.5s ease forwards;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.timetable-page .actions {
    margin-top: 20px;
    text-align: center;
}

.timetable-page .actions button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.timetable-page .actions button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.timetable-page .tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.timetable-page .tooltip.show {
    opacity: 1;
}

/* Ensure table is fully visible for image capture */
#timetableContent, #timetableContent * {
    overflow: visible !important;
    position: static !important;
    max-height: none !important; /* Prevent height restrictions */
}
/* Slots page styles */
.slots-page {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.slots-page .container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slots-page h1, .slots-page h2 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slots-page .form-section, .slots-page .slots-section, .slots-page .config-section {
    margin-bottom: 20px;
}

.slots-page .input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.slots-page .input-group {
    display: flex;
    flex-direction: column;
}

.slots-page label {
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

.slots-page input, .slots-page select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.slots-page input:focus, .slots-page select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.slots-page input.valid, .slots-page select.valid {
    border-color: #28a745;
}

.slots-page button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    position: relative;
}

.slots-page button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.slots-page button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.slots-page .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.slots-page .error-message {
    color: red;
    text-align: center;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slots-page .error-message.show {
    opacity: 1;
}

.slots-page table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
}

.slots-page th, .slots-page td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.slots-page th {
    background: #007bff;
    color: white;
    cursor: pointer;
}

.slots-page tr {
    transition: background 0.3s ease;
}

.slots-page tr:hover {
    background: #f0f0f0;
}

.slots-page tr.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; height: 0; padding: 0; margin: 0; }
}

.slots-page .delete-btn {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slots-page .delete-btn:hover {
    background: #c82333;
}

.slots-page .slots-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.slots-page .filter-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    width: 200px;
}

.slots-page .sort-btn {
    padding: 8px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slots-page .sort-btn:hover {
    background: #5a6268;
}

.slots-page .toggle-btn {
    padding: 5px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slots-page .toggle-btn:hover {
    background: #5a6268;
}

.slots-page .collapsed > *:not(h2) {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .slots-page .input-grid {
        grid-template-columns: 1fr;
    }

    .slots-page .slots-controls {
        flex-direction: column;
        gap: 5px;
    }

    .slots-page .filter-input {
        width: 100%;
    }

    .slots-page table, .slots-page thead, .slots-page tbody, .slots-page th, .slots-page td, .slots-page tr {
        display: block;
        width: 100%;
    }

    .slots-page thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .slots-page tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }

    .slots-page td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: left;
    }

    .slots-page td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }

    .slots-page td[data-label="Action"] {
        padding-left: 10px;
    }

    .slots-page td[data-label="Action"]:before {
        content: "";
    }
}

/* Data labels for mobile */
.slots-page td {
    data-label: attr(data-label);
}

.login-page {
    font-family: Arial, sans-serif;
    background: #f0f0f0; /* Light gray background to contrast the form */
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-page .form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: white;
    padding: 2.5em;
    border-radius: 25px;
    transition: .4s ease-in-out;
    box-shadow: rgba(0, 0, 0, 0.4) 1px 2px 2px;
}

.login-page .form:hover {
    transform: translateX(-0.5em) translateY(-0.5em);
    border: 1px solid #171717;
    box-shadow: 10px 10px 0px #666666;
}

.login-page .heading {
    color: black;
    padding-bottom: 2em;
    text-align: center;
    font-weight: bold;
}

.login-page .input-group {
    position: relative;
}

.login-page .input {
    border-radius: 5px;
    border: 1px solid whitesmoke;
    background-color: whitesmoke;
    outline: none;
    padding: 0.7em;
    transition: .4s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.login-page .input:hover {
    box-shadow: 6px 6px 0px #969696,
                -3px -3px 10px #ffffff;
}

.login-page .input:focus {
    background: #ffffff;
    box-shadow: inset 2px 5px 10px rgba(0,0,0,0.3);
}

.login-page .input.valid {
    border-color: #28a745; /* Green border for valid input */
}

.login-page .password-wrapper {
    position: relative;
}

.login-page .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
}

.login-page .btn {
    margin-top: 2em;
    align-self: center;
    padding: 0.7em 1em;
    border-radius: 10px;
    border: none;
    color: black;
    transition: .4s ease-in-out;
    box-shadow: rgba(0, 0, 0, 0.4) 1px 1px 1px;
    position: relative;
    background: #f0f0f0; /* Matches input background */
}

.login-page .btn:hover {
    box-shadow: 6px 6px 0px #969696,
                -3px -3px 10px #ffffff;
    transform: translateX(-0.5em) translateY(-0.5em);
}

.login-page .btn:active {
    transition: .2s;
    transform: translateX(0em) translateY(0em);
    box-shadow: none;
}

.login-page .btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.login-page .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #666;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.login-page .error-message {
    color: red;
    text-align: center;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-page .error-message.show {
    opacity: 1;
}