/*
    style.css
    This file contains all the custom CSS for the application,
    used by both login.html and index.html.
*/

/* --- General Styles --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* --- Login Page Styles --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-card {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.login-card-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-card-header h2 {
    font-weight: 700;
    color: #343a40;
}
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #ddd;
    box-shadow: none;
    transition: border-color 0.2s ease-in-out;
}
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}
.btn-primary {
    width: 100%;
    border-radius: 0.5rem;
    background-color: #007bff;
    border-color: #007bff;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004d9c;
    transform: translateY(-2px);
}
.btn-secondary {
    border-radius: 0.5rem;
}
.btn-danger {
    border-radius: 0.5rem;
}

/* --- Dashboard Styles --- */
.navbar {
    position: relative; /* Add this line */
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    color: #343a40 !important;
}
.nav-link.active {
    color: #007bff !important;
    font-weight: 600;
}
.nav-link {
    transition: color 0.2s ease-in-out;
}
.nav-link:hover {
    color: #0056b3 !important;
}
.floating-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    background-color: #007bff;
    border: none;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}
.floating-button:hover {
    transform: scale(1.1);
    background-color: #0056b3;
}
/* --- Modern Maintenance Badge Styles --- */
.maintenance-badge {
    position: absolute; 
    left: 50%;          
    top: 50%;           
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem; /* Matches other buttons */
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #f8f9fa; /* Light gray default */
    border: 1px solid #dee2e6; /* Subtle border */
    color: #495057;
    transition: all 0.3s ease-in-out;
}

.maintenance-badge .maintenance-hours {
    font-weight: 700;
}

/* Color States */
.maintenance-badge.bg-green {
    background-color: #e9f7ec;
    border-color: #a7d7b5;
    color: #2a6e40;
}

.maintenance-badge.bg-orange {
    background-color: #fff4e0;
    border-color: #ffca7a;
    color: #8c5d0f;
}

.maintenance-badge.bg-red {
    background-color: #fdeeee;
    border-color: #f2b5b5;
    color: #b02a2a;
}

.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.table-row-clickable:hover {
    background-color: #f1f1f1 !important;
}
.table thead th {
    cursor: pointer;
    white-space: nowrap;
}
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    .maintenance-counter {
        margin-top: 1rem;
        justify-content: center;
    }
    .floating-button {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
}
/* --- Footer Styles for Admin Link --- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 10px 15px;
    background-color: transparent;
    z-index: 1000;
}

.app-footer a {
    font-size: 0.8rem;
    color: #6c757d; /* Bootstrap's text-muted color */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.app-footer a:hover {
    color: #343a40; /* Darker text on hover */
    text-decoration: underline;
}

/* --- Dark Mode Styles --- */
.dark-mode {
    background-color: #000000; /* AMOLED true black background */
    color: #e0e0e0;
}

.dark-mode .navbar {
    background-color: #000000; /* AMOLED true black navbar */
    border-bottom: 1px solid #222;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.dark-mode .card,
.dark-mode .modal-content {
    background-color: #121212; /* Very dark grey for elevated surfaces */
    border: 1px solid #333;
}

.dark-mode .navbar-brand,
.dark-mode .nav-link {
    color: #f5f5f5 !important;
}

.dark-mode .nav-link.active {
    color: #58a6ff !important;
}

.dark-mode .nav-link:hover {
    color: #80c4ff !important;
}

.dark-mode .maintenance-badge {
    background-color: #212121;
    border-color: #333;
    color: #f5f5f5;
}

.dark-mode .maintenance-badge.bg-green {
    background-color: #1c3d2f;
    border-color: #2a6e40;
    color: #a7d7b5;
}
.dark-mode .maintenance-badge.bg-orange {
    background-color: #4d3d1f;
    border-color: #8c5d0f;
    color: #ffca7a;
}
.dark-mode .maintenance-badge.bg-red {
    background-color: #5c2c2f;
    border-color: #b02a2a;
    color: #f2b5b5;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #212121;
    border-color: #444;
    color: #f5f5f5;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #333;
    border-color: #58a6ff;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

/* Fix for invisible time text in FullCalendar dark mode */
.dark-mode .fc .fc-timegrid-axis-cushion,
.dark-mode .fc .fc-timegrid-slot-label-cushion {
    color: #e0e0e0 !important;
}

/* FINAL UNIFIED TABLE STYLES */

.dark-mode .card-header {
    background-color: #1e1e1e;
    border-bottom-color: #333;
}
.dark-mode .card,
.dark-mode .modal-content {
    background-color: #121212;
    border: 1px solid #333;
}
.dark-mode .card-header {
    background-color: #1e1e1e;
    border-bottom-color: #333;
}

.dark-mode .list-group-item {
    background-color: transparent;
    border-color: #333;
    color: #e0e0e0;
}
.dark-mode .table {
    --bs-table-color: #e0e0e0;
    --bs-table-bg: #121212;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: #e0e0e0; /* This ensures striped row font is always white */
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: #e0e0e0;
    --bs-table-border-color: #333;
    color: var(--bs-table-color);
    background-color: var(--bs-table-bg);
}

.dark-mode .table thead th {
    background-color: #1e1e1e;
    color: #f5f5f5;
    border-bottom-width: 2px;
    border-color: #444;
}

/* Fix for SQWKS table colored rows in dark mode */
.dark-mode tr.table-success {
    --bs-table-color: #e0e0e0;
    --bs-table-bg: #121212;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: #e0e0e0; /* This ensures striped row font is always white */
    --bs-table-bg: #1c3d2f;
    --bs-table-color: #e0e0e0; /* White text */
    --bs-table-striped-bg: #1c3d2f;
    --bs-table-hover-bg: #2a6e40;
}

.dark-mode tr.table-danger {
    --bs-table-color: #e0e0e0;
    --bs-table-bg: #121212;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: #e0e0e0; /* This ensures striped row font is always white */
    --bs-table-bg: #5c2c2f;
    --bs-table-color: #e0e0e0; /* White text */
    --bs-table-striped-bg: #5c2c2f;
    --bs-table-hover-bg: #b02a2a;
}
/* END FINAL UNIFIED TABLE STYLES */

.dark-mode .modal-header,
.dark-mode .modal-footer {
    border-color: #333;
}

.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode .fc .fc-toolbar-title,
.dark-mode .fc-col-header-cell-cushion,
.dark-mode .fc-daygrid-day-number {
    color: #f5f5f5;
}

.dark-mode .fc-day-today {
    background: rgba(88, 166, 255, 0.15) !important;
}

/* --- Theme Switch Styles --- */

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch-wrapper .fas {
    color: #6c757d;
}
.dark-mode .theme-switch-wrapper .fas {
    color: #adb5bd;
}

/* --- Theme Switch Styles --- */
.theme-switch-wrapper .fas {
    color: #6c757d;
}
.dark-mode .theme-switch-wrapper .fas {
    color: #adb5bd;
}

/* --- Theme Switch Styles --- */
.theme-switch-wrapper .fas {
    color: #6c757d;
}
.dark-mode .theme-switch-wrapper .fas {
    color: #adb5bd;
}
/* Hide the predicted due date on mobile screens */
.d-lg-none .maintenance-due-date {
    display: none;
}

/* --- Vertical Maintenance Tab (Mobile) --- */
.maintenance-tab {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(270deg); /* Simpler transform */
    transform-origin: bottom right;
    z-index: 999;
    
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    
    background-color: #343a40;
    border: 1px solid #444;
    border-bottom: none;
    
    color: #f5f5f5;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: -2px 0px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease-in-out;
}

/* Color states */
.maintenance-tab.bg-green {
    background-color: #1c3d2f;
    border-color: #2a6e40;
    color: #a7d7b5;
}
.maintenance-tab.bg-orange {
    background-color: #4d3d1f;
    border-color: #8c5d0f;
    color: #ffca7a;
}
.maintenance-tab.bg-red {
    background-color: #5c2c2f;
    border-color: #b02a2a;
    color: #f2b5b5;
}

.dark-mode .maintenance-tab {
     background-color: #212121;
}
/* --- Top Floating Maintenance Card (Desktop) --- */
.maintenance-card-top {
    position: fixed;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem; /* Rectangular shape */
    
    background-color: rgba(248, 249, 250, 0.85); /* Semi-transparent light grey */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid #dee2e6;
    
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
}

.dark-mode .maintenance-card-top {
     background-color: rgba(20, 20, 20, 0.75);
     border-color: #333;
     color: #f5f5f5;
}
.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* Color states */
.maintenance-card-top.bg-green {
    background-color: rgba(25, 135, 84, 0.85);
    border-color: #2a6e40;
    color: #fff;
}
.maintenance-card-top.bg-orange {
    background-color: rgba(255, 193, 7, 0.85);
    border-color: #8c5d0f;
    color: #111;
}
.maintenance-card-top.bg-red {
    background-color: rgba(220, 53, 69, 0.85);
    border-color: #b02a2a;
    color: #fff;
}
/* --- Mobile-Specific Calendar Styles --- */
@media (max-width: 767px) and (orientation: portrait) {
    .fc {
        height: 80vh !important; /* vh = viewport height */
    }
}

/* --- Readonly Input Field Style --- */
input[readonly] {
    background-color: #e9ecef; /* Light grey background */
    cursor: not-allowed; /* Show a 'not allowed' cursor on hover */
}

/* Style for dark mode */
.dark-mode input[readonly] {
    background-color: #3a3b3c;
}

/* --- Input Group Radio Button Fix --- */
.input-group-text {
    background-color: var(--bs-secondary-bg);
}   

/* --- FINAL TABLE ROW STYLES --- */

/* STEP 1: Completely neutralize Bootstrap's striping and hover effects 
  for both light and dark modes.
*/
.table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: transparent;
}
.table-hover > tbody > tr:hover {
    --bs-table-hover-bg: transparent;
}


/* STEP 2: Apply our own simple, solid background colors.
  These will no longer have to fight with the striped styles.
*/

/* Light Mode */
.table-row-clickable {
    background-color: #ffffff; /* White for not invoiced */
    color: #111;
}
.table-row-clickable:hover {
    background-color: #f0f0f0; /* Light grey hover */
}
.table-secondary, .table-secondary:hover {
    background-color: #e9f7ec !important; /* Light green for invoiced (and its hover state) */
    color: #111 !important;
}

/* Dark Mode */
.dark-mode .table-row-clickable {
    background-color: #000000; /* Black for not invoiced */
    color: #f5f5f5;
}
.dark-mode .table-row-clickable:hover {
    background-color: #222222; /* Dark grey hover */
}
.dark-mode .table-secondary, .dark-mode .table-secondary:hover {
    background-color: #ffffff !important; /* White for invoiced */
    color: #111111 !important;
}
/* Dark mode fix for input group (VFR/IFR radio buttons) */
.dark-mode .input-group-text {
    background-color: #212121;
    border-color: #444;
    color: #e0e0e0;
}
.dark-mode .card-title {
    color: #f5f5f5; /* Light text color for titles */
}
/* Fix for unreadable calendar header in dark mode with auto height */
.dark-mode .fc-col-header-cell {
    background-color: #121212;
}
/* Final fix for "today" column and top-left corner in dark mode */
.dark-mode .fc-day-today {
    background-color: rgba(88, 166, 255, 0.15) !important;
}

.dark-mode .fc .fc-timegrid-axis {
    background-color: #121212;
    border-color: #333;
}
/* style.css */

.fee-row-clickable {
    cursor: pointer;
}

/* You can place it before or after your existing .table-row-clickable style */
.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

/* Add this to style.css */

.maintenance-due-date {
    /* Explicitly set height and properties for a smooth transition */
    height: 1.2em;
    opacity: 1;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}

#maintenanceCard-desktop.collapsed .maintenance-due-date {
    /* When collapsed, shrink height and fade out */
    height: 0;
    opacity: 0;
    margin-top: -5px; /* Optional: Tightens up the vertical space */
}
/* Add this to your style.css file */
.column-filter {
    margin-top: 5px;
    width: 100%;
    display: block;
}
/* Add this to style.css */

#bug-report-button {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* In style.css */

.expandable-row {
    cursor: pointer;
}

.detail-content {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
}

.dark-mode .detail-content {
    background-color: rgba(255, 255, 255, 0.05);
}

.expandable-row .fa-plus-circle, .expandable-row .fa-minus-circle {
    transition: transform 0.3s ease;
}

.expandable-row.open .fa-plus-circle {
    transform: rotate(45deg);
}
.dark-mode .card-text {
    color: #e0e0e0; /* Use the standard light grey text color for dark mode */
}
/* In static/css/style.css */

/* --- Dark Mode Accordion Styles --- */
.dark-mode .accordion-item {
    background-color: #212121;
    border-color: #333;
    color: #e0e0e0;
}

.dark-mode .accordion-button {
    background-color: #343a40;
    color: #f5f5f5;
}

.dark-mode .accordion-button:not(.collapsed) {
    background-color: #0d6efd;
    color: white;
}

.dark-mode .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-mode .accordion-body {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

.dark-mode .list-group-item {
    background-color: transparent;
    border-color: #333;
    color: #e0e0e0;
}
/* This targets the card and list items ONLY when dark mode is active */
body.dark-mode .card {
    background-color: #212529; /* A standard dark background color */
    color: #f8f9fa;           /* A light color for all text inside the card */
}

body.dark-mode .list-group-item {
    background-color: transparent; /* Makes list items inherit the card's background */
    color: #f8f9fa;               /* Ensures text in list items is also light */
    border-color: rgba(255, 255, 255, 0.125); /* A subtle border for dark mode */
}

/* This ensures the subtitle headings are also light */
body.dark-mode .card-subtitle {
    color: #adb5bd !important; /* A slightly less bright color for subtitles */
}