/* Loading spinner animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner {
    animation: spin 1s linear infinite;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    display: inline-block;
}

/* Smooth transitions */
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Table row hover effect */
tbody tr { transition: background-color 0.15s ease; }

/* Global touch & layout adjustments */
html, body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Horizontal and Vertical Scrollbars */
.overflow-x-auto::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.overflow-x-auto::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.8);
    border-radius: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 1);
}

/* Form Controls Uniform Height & Normalization */
input[type="date"],
input[type="text"],
select,
#btnOriginDropdown,
#btnDestDropdown {
    height: 44px;
    min-height: 44px;
    line-height: 1.25rem;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

/* Global Centered Selects */
select {
    text-align: center !important;
    text-align-last: center !important;
    -webkit-text-align-last: center !important;
    -moz-text-align-last: center !important;
}

select option {
    text-align: left;
}

/* Custom WebKit/Blink Date Input Centering & Normalization */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center !important;
    padding-left: 2rem; /* Balances calendar icon for visual centering */
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    cursor: pointer;
    margin-left: 0;
    padding-right: 0.25rem;
    opacity: 0.8;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="date"]::-webkit-datetime-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Touch friendly momentum scroll for tables */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* Touch target comfort */
    button, select, input[type="date"], input[type="text"] {
        min-height: 44px;
    }

    /* Modal / dropdown panels shadow and max height */
    #originDropdownPanel,
    #destDropdownPanel {
        max-height: 80vh;
    }
}
