﻿/* === GENERAL LAYOUT === */

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    padding-bottom: 4rem;
}

/* === TOAST === */

.toast-custom-above-footer {
    bottom: 70px !important; /* Adjust depending on your footer height */
    right: 20px;
}

/* === FOOTER === */
footer.footer {
    flex-shrink: 0;
    height: 60px;
    background-color: #f8f9fa;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

/* === Log Files === */
body.vs-dark .log-content pre {
    background-color: #1e1e1e !important; /* Force override inline style */
    color: #d4d4d4;
    border: 1px solid #3c3c3c;
    border-radius: 5px;
    max-height: 600px;
    overflow-y: auto;
    font-family: Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    box-shadow: inset 0 0 5px #000;
}

/* === DATATABLES LAYOUT === */

/* Flex container for dropdown + search */
.dt-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Page length dropdown */
.dataTables_length {
    flex: 1 1 auto;
    min-width: 160px;
    margin-bottom: 0;
}

/* Search box alignment */
.dataTables_filter {
    flex: 1 1 auto;
    min-width: 160px;
    margin-bottom: 0;
    text-align: right;
}

.dataTables_filter input {
    width: auto;
    display: inline-block;
}

/* Buttons (like page length) */
.buttons-page-length {
    margin-left: 8px;
}

/* Table scrollability on smaller screens */
.table-responsive {
    overflow-x: auto;
}

/* === PAGINATION STYLING === */
.dataTables_paginate {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* === RESPONSIVE TWEAKS === */
@media (max-width: 576px) {
    .dt-controls {
        flex-direction: column;
    }

    .dataTables_filter,
    .dataTables_length {
        flex: 100%;
        text-align: left;
    }

    .dataTables_filter input {
        width: 100%;
    }
}

/* === CUSTOM BUTTONS === */
.btn-view {
    background-color: #0d6efd;
    color: white;
}

.btn-download {
    background-color: #198754;
    color: white;
}

/* === VISUAL STUDIO DARK MODE === */
body.vs-dark {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

body.vs-dark #themeToggle {
    background-color: #2d2d2d;
    color: #d4d4d4;
    border-color: #444;
}

body.vs-dark a {
    color: #569cd6;
}

body.vs-dark .btn,
body.vs-dark .btn-primary,
body.vs-dark .btn-outline-secondary {
    color: #d4d4d4;
    background-color: #2d2d2d;
    border-color: #444;
}

body.vs-dark .btn:hover {
    background-color: #3c3c3c;
    border-color: #555;
}

/* Light theme default */
footer.footer {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 10px 0;
    text-align: center;
    width: 100%;
    border-top: 1px solid #dee2e6;
}

/* VS Dark theme override */
body.vs-dark footer,
body.vs-dark footer.footer {
    background-color: #252526;
    color: #999999;
    border-top: 1px solid #3c3c3c;
}

body.vs-dark footer a {
    color: #9cdcfe;
}

body.vs-dark footer a:hover {
    text-decoration: underline;
}

/* DataTables - Table styling */
body.vs-dark table.dataTable,
body.vs-dark table.dataTable td,
body.vs-dark table.dataTable th {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    border-color: #3c3c3c !important;
}

body.vs-dark table.dataTable thead {
    background-color: #2d2d30 !important;
    border-bottom: 1px solid #444 !important;
}

body.vs-dark table.dataTable thead th {
    border-bottom: 1px solid #444444 !important;
}

body.vs-dark table.dataTable tbody tr:nth-child(even),
body.vs-dark table.dataTable tbody tr:nth-child(odd) {
    background-color: #252526 !important;
}

body.vs-dark table.dataTable tbody tr:hover {
    background-color: #2a2a2a !important;
}

body.vs-dark table.dataTable tbody td {
    border-top: 1px solid #2a2a2a;
}

body.vs-dark .dataTables_wrapper {
    color: #d4d4d4;
    background-color: #1e1e1e !important;
}

/* DataTables - Filter/Length controls */
body.vs-dark .dataTables_wrapper .dataTables_filter input,
body.vs-dark .dataTables_wrapper .dataTables_length select,
body.vs-dark .dataTables_paginate .paginate_button {
    background-color: #2d2d30 !important;
    color: #d4d4d4 !important;
    border: 1px solid #444 !important;
}

body.vs-dark .dataTables_filter input:focus,
body.vs-dark .dataTables_length select:focus {
    outline: none;
    border-color: #569cd6;
    box-shadow: 0 0 0 2px rgba(86, 156, 214, 0.2);
}

/* DataTables - Buttons */
body.vs-dark .dt-button,
body.vs-dark .buttons-page-length {
    background-color: #2d2d2d;
    color: #d4d4d4;
    border: 1px solid #444444;
}

body.vs-dark .dt-button:hover {
    background-color: #3a3a3a;
    color: white;
}

/* DataTables - Pagination */
body.vs-dark .dataTables_paginate .paginate_button.current,
body.vs-dark .dataTables_paginate .paginate_button:hover {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
    border-color: #555555;
}

/* === VS DARK: Modals === */
body.vs-dark .modal-content {
    background-color: #2d2d2d;
    color: #d4d4d4;
    border: 1px solid #3c3c3c;
}

body.vs-dark .modal-header,
body.vs-dark .modal-footer {
    border-color: #3c3c3c;
}

body.vs-dark .modal-title {
    color: #d4d4d4;
}

body.vs-dark .btn-close {
    filter: invert(1); /* make close button visible */
}

/* === VS DARK: Forms === */
body.vs-dark input,
body.vs-dark select,
body.vs-dark textarea {
    background-color: #2d2d2d !important;
    color: #d4d4d4 !important;
    border: 1px solid #444 !important;
}

body.vs-dark input::placeholder,
body.vs-dark textarea::placeholder {
    color: #888888;
}

body.vs-dark label {
    color: #cccccc;
}

/* === VS DARK: Cards === */
body.vs-dark .card {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #d4d4d4;
}

/* === VS DARK: Alerts === */
body.vs-dark .alert {
    background-color: #3d3d3d;
    color: #f5f5f5;
    border-color: #555;
}