/* Apply smooth transitions to key elements that change color or background in dark mode */
body, header, main, footer, #jobTable th, #jobTable tbody tr {
    transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

body {
    margin: 0;
    background-color: #f4f4f9;
    padding: 0;
    color: #333;
    font-family: Arial, sans-serif;
}

header {
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #1f2937;
    padding: 10px;
    width: 100%;
    color: white;
    text-align: center;
}

h1 {
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 2em;
}

main {
    margin: 20px auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    padding: 20px;
    max-width: 1200px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* ================================================= */
/* CONTROL TRANSITIONS (INPUT/SELECT) */
/* ================================================= */
.dt-search input, .dt-length select {
    flex-grow: 1;
    /* Transition for border color and box shadow */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    max-width: 200px;
}

.dt-search input {
    width: 40vw;
    max-width: 500px;
}

/* Focus state for a modern 'lift' effect */
.dt-search input:focus, .dt-length select:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}


.dt-empty {
    text-align: center;
}

.table-container {
    margin: auto;
    max-width: 1200px;
    /* Ensures table is scrollable on small screens */
    overflow-x: auto;
}

#jobTable {
    margin-top: 10px;
    border-collapse: collapse;
    width: 100%;
}

#jobTable th, #jobTable td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

#jobTable th {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Apply transition to all table rows */
#jobTable tbody tr {
    transition: background-color 0.3s ease;
}

#jobTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}


#jobTable tbody tr:hover {
    cursor: pointer;
    background-color: #cfe2ff;
}

footer {
    position: fixed;
    bottom: 0;
    box-sizing: border-box;
    border-top: 1px solid #ddd;
    background-color: lightsteelblue;
    padding: 10px;
    width: 100%;
    font-size: 0.9em;
    text-align: center;
}

footer p {
    margin: 0;
}

/* ================================================= */
/* LINK TRANSITIONS */
/* ================================================= */
a {
    /* Transition for border-bottom to smooth the hover effect */
    transition: border-bottom 0.2s ease;
    text-decoration: none;
}

a:hover, a:focus {
    border-bottom: 2px solid #0056b3;
}


@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    main {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
        background: #121212;
    }

    a {
        color: lightblue;
    }

    a:hover, a:focus {
        border-bottom: 2px solid #d9d9d9;
    }

    #jobTable th {
        background-color: #5c5c5c;
        color: white;
    }

    #jobTable tbody tr:nth-child(2n) {
        background-color: #34343455;
    }

    #jobTable tbody tr:hover {
        background-color: #cfe2ff5e;
    }

    footer {
        background-color: darkslategray;
        color: #ccc;
    }

    footer a {
        color: white
    }

}