/* premium_glass.css */

/* Background & Typography */
body {
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f0f4f8 100%) fixed;
    /* Liquid Glass White Aesthetic */
    font-family: 'Inter', sans-serif !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #1f2937;
    /* Gray 800 */
}

/* Glass Container (Main Card) */
.app-container {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-radius: 20px !important;
    margin: 0 !important; /* Zero margin at bottom */
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; 
    max-height: none !important;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

/* Toolbar */
.toolbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 1.25rem 1.5rem !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Search Box (Glassy Input) */
.search-box-simple {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important; /* Curved */
    padding: 0.5rem 1rem !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s ease;
    width: 350px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.search-box-simple i {
    color: #4b5563 !important;
    margin-right: 4px !important;
    font-size: 0.9rem !important;
}

.search-box-simple:focus-within {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
    /* Green glow focus */
    border-color: #10b981 !important;
}

.search-box-simple input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #1f2937 !important;
    font-weight: 500;
    width: 100%;
}

select.form-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #1f2937 !important;
    font-weight: 500;
}

.search-box-simple i {
    color: #4b5563 !important;
}

/* Buttons */
.icon-action {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.2s ease;
}

.icon-action:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-black {
    background: #000 !important;
    color: white !important;
    border-radius: 12px !important; /* Curved */
    padding: 0.6rem 1.2rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

.btn-black:hover {
    background: #222 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Table Styling */
.device-list {
    flex: 1;
    overflow: auto !important;
    min-height: 0;
    max-height: calc(100vh - 180px) !important; /* Limit list height to fit screen */
}

.vehicle-table {
    border-collapse: separate !important;
    border-spacing: 0 0.5rem !important;
    margin-top: 0.5rem;
    width: 100%;
}

.vehicle-table thead th {
    background: #f8fafc !important; /* Solid light grey header background */
    color: #4b5563 !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1rem !important;
}

.vehicle-table tbody tr {
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03); /* Subtle row divider */
}

.vehicle-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.85) !important;
}

.vehicle-table td {
    border: none !important;
    padding: 0.85rem 1rem !important;
    color: #1f2937;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Rounded corners for rows restored */
.vehicle-table td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.vehicle-table td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Ensure sticky cells respect parent row background and blend seamlessly */
.vehicle-table tbody tr td:nth-child(1),
.vehicle-table tbody tr td:nth-child(2) {
    background: rgba(255, 255, 255, 0.1) !important; /* Extremely translucent base */
    backdrop-filter: blur(15px) !important; 
    -webkit-backdrop-filter: blur(15px) !important;
}

.vehicle-table tbody tr td:nth-child(1) {
    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
}

/* Fix for the "Box" look on sticky cells - make them non-box like */
.vehicle-table tbody tr td:nth-child(2) {
    border-right: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.vehicle-table tbody tr:hover td:nth-child(1),
.vehicle-table tbody tr:hover td:nth-child(2) {
    background: rgba(255, 255, 255, 0.25) !important;
}



/* Status Icons */
.status-icon {
    font-size: 1.1rem !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Modal Glass */
.modal-content {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

.form-input,
.search-box-input {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05) !important;
    padding: 0.8rem !important;
    border-radius: 10px !important;
    color: #1f2937 !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4) !important;
}

.form-input:hover,
.search-box-input:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

input[type="file"].form-input {
    padding: 0.6rem !important;
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.2) !important;
    outline: none !important;
}

/* Uppercase Enforcement */
.t-vehicle,
.form-input[id^="inp-vehicle"],
#search-input,
#inp-vehicle {
    text-transform: uppercase !important;
}

/* --- Expiry Indicators --- */
@keyframes blink {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 5px #facc15;
    }

    50% {
        opacity: 0.4;
        transform: scale(0.9);
        box-shadow: 0 0 2px #facc15;
    }

    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 5px #facc15;
    }
}

.expiry-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 10px;
    margin-left: 0;
    background-color: transparent;
    vertical-align: middle;
    flex-shrink: 0;
}

.expiry-yellow {
    background-color: #facc15 !important;
    animation: blink 2s infinite;
    box-shadow: 0 0 10px #facc15, 0 0 20px rgba(250, 204, 21, 0.4);
}

.expiry-red {
    background-color: #ef4444 !important;
    box-shadow: 0 0 8px #ef4444, 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Align contents of vehicle cell for indicator */
.t-vehicle {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    /* No gap, margin on indicator handles spacing */
}

/* Uppercase Modal Title */
#modal-vehicle-title {
    text-transform: uppercase !important;
}

.expiry-green {
    background-color: #10b981 !important;
    box-shadow: 0 0 8px #10b981, 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Active Filter Styling */
.badge-active {
    box-shadow: 0 0 0 2px white, 0 0 0 3px currentColor !important;
    transform: scale(1.05);
    background: white !important;
}

#stats-badge, #outstanding-badge {
    transition: all 0.2s ease;
}

#stats-badge:hover, #outstanding-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Enhanced Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-select {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    color: #1e293b !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.page-size-select:hover {
    border-color: #10b981 !important;
}

.pagination-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-btn {
    background: white !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    color: #4b5563 !important;
    min-width: 40px;
    height: 40px;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3f4f6 !important;
}

.pagination-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-num {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.5);
    color: #4b5563;
}

.page-num:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.page-num.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.pagination-ellipsis {
    color: #9ca3af;
    padding: 0 4px;
}

/* Autocomplete Dropdown */
.autocomplete-items {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
    font-size: 0.9rem;
    color: #333;
}

.autocomplete-item:hover {
    background-color: #e9ecef;
}

.autocomplete-item strong {
    font-weight: 600;
    color: #000;
}

/* Freeze Table Headers */
.vehicle-table thead {
    position: sticky;
    top: 0;
    z-index: 50;
}

.vehicle-table th {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Freeze First Two Columns Horizontally */
.vehicle-table th:nth-child(1),
.vehicle-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.vehicle-table th:nth-child(2),
.vehicle-table td:nth-child(2) {
    position: sticky;
    left: 45px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.4) !important; /* Higher opacity for 2nd column label */
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03); /* Softer edge shadow */
}

.vehicle-table th:nth-child(1),
.vehicle-table th:nth-child(2) {
    z-index: 60; /* Above other sticky headers */
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5) !important;
}

/* --- Glass Action Buttons (Certificates) --- */
.glass-action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(243, 244, 246, 0.8) !important;
    color: #374151 !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    backdrop-filter: blur(5px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease !important;
}

.glass-action-btn:hover {
    background: #e5e7eb !important;
    transform: translateY(-1px);
}

.glass-action-btn.danger {
    background: rgba(254, 226, 226, 0.8) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
}

.glass-action-btn.danger:hover {
    background: #fecaca !important;
}

/* Calendar Multi-Month Filter Styling */
.calendar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000;
    padding: 1rem;
    transition: all 0.3s ease;
}

.calendar-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1px);
    pointer-events: none;
}

.calendar-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.calendar-dropdown-header span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.clear-btn {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.month-item {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-item:hover {
    background: white;
    border-color: #10b981;
    color: #10b981;
    transform: scale(1.05);
}

.month-item.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.calendar-filter-container button:hover {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    border-color: #6366f1 !important;
}