/* assets/css/style.css */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}


.main-layout {
    display: flex;
    width: 98%;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    min-height: 80vh;
}

.sidebar {
    width: 250px;
    background-color: #f9f9f9;
    padding: 20px;
    border-right: 1px solid #eee;
    flex-shrink: 0;
}

.content {
    flex-grow: 1;
    padding: 20px;
    overflow-x: auto;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.2em;
    color: #2c3e50;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.filter-group {
    margin-bottom: 20px;
    position: relative;
    /* For autocomplete positioning */
}

.filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.filter-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Autocomplete Styles */
.autocomplete-suggestions {
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    position: absolute;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 4px 4px;
}

.autocomplete-suggestion {
    padding: 8px 10px;
    cursor: pointer;
}

.autocomplete-suggestion:hover {
    background-color: #f0f0f0;
}


.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.checkbox-list label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
    cursor: pointer;
}

.btn-filter {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-filter:hover {
    background-color: #2980b9;
}

h1 {
    text-align: left;
    color: #2c3e50;
    margin-top: 0;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

th {
    background-color: #2c3e50;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

th a {
    color: #fff;
    text-decoration: none;
    display: block;
}

th a:hover {
    text-decoration: underline;
}

/* Row Colors */
tr.row-tfm {
    background-color: #e3f2fd !important;
    /* Light Blue */
}

tr.row-lnk {
    background-color: #f5f5f5 !important;
    /* Light Gray */
}

tr.row-lnk:hover,
tr.row-tfm:hover {
    filter: brightness(0.95);
    /* Slight darken on hover */
}

tr:hover {
    background-color: #f1f1f1;
}

tr:nth-child(even) {
    background-color: #fbfbfb;
    /* Will be overridden by specific classes if set */
}

/* Editable Cells */
.editable-cell {
    cursor: text;
    transition: background-color 0.2s;
    outline: none;
}

.editable-cell:hover {
    background-color: #fffde7;
    /* Light yellow on hover */
    box-shadow: inset 0 0 0 1px #ddd;
}

.editable-cell:focus {
    background-color: #fff;
    box-shadow: inset 0 0 0 2px #3498db;
    border-radius: 2px;
}

/* Save Feedback */
.save-success {
    background-color: #d4edda !important;
    animation: fadeOutSuccess 1.5s forwards;
}

.save-error {
    background-color: #f8d7da !important;
    animation: fadeOutError 1.5s forwards;
}

@keyframes fadeOutSuccess {
    0% {
        background-color: #d4edda;
    }

    100% {
        background-color: transparent;
    }
}

@keyframes fadeOutError {
    0% {
        background-color: #f8d7da;
    }

    100% {
        background-color: transparent;
    }
}

p {
    text-align: center;
    font-size: 1.2em;
    color: #666;
}

/* Modal Styles - Premium & Centered */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    padding: 40px;
    /* Increased padding */
    border-radius: 12px;
    width: 75%;
    height: 70%;
    max-width: 1200px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-sidebar {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    color: white;
}

.btn-refresh {
    background-color: #34495e;
}

.btn-refresh:hover {
    background-color: #2c3e50;
}

.btn-update {
    background-color: #27ae60;
}

.btn-update:hover {
    background-color: #2ecc71;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 90%;
        padding: 20px;
    }
}

.modal-title {
    font-size: 2.2em;
    /* Much larger */
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.chart-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Spinner */
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.2s;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: #e74c3c;
}

#historyChart {
    flex-grow: 1;
    width: 100% !important;
    height: 100% !important;
}