pre.pre-wrap {
    white-space: pre-wrap;       /* css-3 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

tr.clickable:hover {
    background-color: #1779ba;
    color: #fefefe;
}

#drop-box {
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 400px;
}

#drop-zone {
    width: 400px;
    height: 100px;
    border: 2px dashed #bbb;
    line-height: 100px;
    text-align: center;
    background-color: #fafafa;
    cursor: pointer;
}

#file-input {
    display: none;
}

@-webkit-keyframes fadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    90% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        display: none;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    90% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        display: none;
    }
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    animation: fadeOut 5s forwards;
    -webkit-animation: fadeOut 5s forwards;
    /* Add opacity explicitly for browsers that don't support animations */
    opacity: 1;
}

#error-message {
    display: none;
    margin-top: 20px;
    padding: 10px;
    background-color: #f44336;
    color: white;
}

.warning-message {
    margin-top: 20px;
    padding: 10px;
    background-color: #FEF3C7;
    color: #92400E;
}

#success-message {
    display: none;
    margin-top: 20px;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    animation: fadeOut 5s forwards;
    -webkit-animation: fadeOut 5s forwards;
    /* Add opacity explicitly for browsers that don't support animations */
    opacity: 1;
}

#upload-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
}

#clear-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
}

#login-container {
    width: 300px;
    padding: 16px;
    background-color: white;
    margin: 0 auto;
    margin-top: 100px;
    border: 1px solid black;
    border-radius: 4px;
}

.login-info {
    width: 300px;
    margin: 12px auto 0;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

input[type=text], input[type=password] {
    width: 100%;
    padding: 15px;
    margin: 5px 0 22px 0;
    display: inline-block;
    border: none;
    background: #f1f1f1;
}

.visibility-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-25%); /* Adjusted to account for label space */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #666;
    /* Ensure button stays above input */
    z-index: 2;
}

.visibility-btn:hover {
    color: #333;
}

.visibility-btn:focus {
    outline: none;
    color: #333;
}

#login-submit {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: 100%;
    opacity: 0.9;
}

#login-container button:hover {
    background-color: #45a049;
}

#login-error-message {
    color: red;
    margin-top: 10px;
}

.session-expire-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.session-expire-modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 20%; /* Could be more or less, depending on screen size */
}

/* Session expiration modal - equal width buttons */
#sessionExpireModal .modal-footer .btn {
    min-width: 130px;
}

.setup-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.setup-container h1 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.setup-container article {
    margin-bottom: 2rem;
}

.setup-container .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.setup-container .form-group label {
    flex: 0 0 30%;
    margin-bottom: 0;
    margin-right: 1rem;
}

.setup-container .form-group input,
.setup-container .form-group select {
    flex: 1;
}

.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button-container button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.25rem;
}

#prev::before {
    content: "←";
    margin-right: 0.5rem;
}

#next::after {
    content: "→";
    margin-left: 0.5rem;
}

#next:last-child {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

#next:last-child::after {
    content: "";
}

/* Disable Next until all required fields are filled */
.setup-container form:has(:invalid) #next {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.format-timestamp {
    font-family: monospace;
    white-space: nowrap;
}

.format-timestamp::before {
    content: var(--formatted-time);
}

.scrollable-table {
    height: 200px;
    overflow-y: auto;
    margin-bottom: 0;
}

.archive-table {
    height: 200px;
    overflow-y: auto;
    margin-bottom: 0;
}

.scrollable-table .sticky-top {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-table-bg);
}

.scrollable-table::-webkit-scrollbar {
    width: 8px;
}

.scrollable-table::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.scrollable-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.scrollable-table::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table td, .table th {
    white-space: nowrap;
}

#aboutModal .table td {
    white-space: normal;
    word-break: break-all;
}

.cell-wrap {
    white-space: normal !important;
}

.scrollable-table::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
}

.menu a.logout-link {
    display: inline;
    padding: 0;
    margin-left: 8px;
    font-weight: normal;
    font-size: 0.85em;
    color: #666;
    text-decoration: none;
}

.menu a.logout-link:hover {
    color: #333;
    text-decoration: underline;
}

.settings-link {
    display: inline-block;
    padding: 8px;
}

.settings-link svg {
    width: 24px;
    height: 24px;
    fill: #666;
    transition: fill 0.3s ease;
}

.settings-link:hover svg {
    fill: #333;
}

#settingsBody {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background-color: #f5f5f5;
}

.settings-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#players-db-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background-color: #f5f5f5;
}

.players-db-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}



.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

h2 .settings-section-title {
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.settings-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.settings-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 8px 35px 8px 8px;
}

.settings-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
}

.settings-button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.settings-button.primary-button {
    background-color: #007bff;
    color: white;
}

.settings-button.primary-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.settings-button.secondary-button {
    background-color: #6c757d;
    color: white;
}

.settings-button.secondary-button:hover {
    background-color: #5a6268;
}

.settings-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.test-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: -8px;
    margin-bottom: 8px;
}

/* Recently Finished table row styles - use higher specificity to override Bootstrap */
#archive-table tbody tr.success-row > td,
#archive-table tbody tr.failure-row > td {
    border: none;
}

.table tbody tr.success-row,
.table tbody tr.success-row > td {
    background-color: #d4edda;
    color: #155724;
}

.table-hover tbody tr.success-row:hover,
.table-hover tbody tr.success-row:hover > td {
    background-color: #28a745;
    color: #ffffff;
}

.table tbody tr.failure-row,
.table tbody tr.failure-row > td {
    cursor: pointer;
    background-color: #f8d7da;
    color: #721c24;
}

.table-hover tbody tr.failure-row:hover,
.table-hover tbody tr.failure-row:hover > td {
    background-color: #dc3545;
    color: #ffffff;
}

.archive-table {
    height: calc(100vh - 20px); /* Adjust the height to extend close to the full window height */
    overflow-y: auto;
    margin-bottom: 0;
}

.archive-table .sticky-top {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-table-bg);
}

.archive-table::-webkit-scrollbar {
    width: 8px;
}

.archive-table::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.archive-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.archive-table::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* General styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

/* Search Form Container */
.archive-search-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Search Form */
.archive-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Form Group */
.archive-form-group {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
}

/* Label Styling */
.archive-form-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Input and Select Styling */
.archive-form-control {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

