/* Universal */
* {
    scrollbar-width: thin;
    scrollbar-color: #888 #ffffff00 ;
}

/* WebKit browsers */
*::-webkit-scrollbar {
    height: 8px;
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
    border: 2px solid transparent;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.shimmer {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to left, #444 8%, #555 18%, #444 33%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    will-change: background-position;
}

.shimmer-box {
    width: 100px;
    height: 60px;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#site-title {
    transition: text-shadow 0.2s ease-in-out;
    padding-left: 1rem;
}

#site-title:hover {
    text-shadow: 4px 8px 16px rgba(0, 0, 0, 0.9);
}

.pagetitle {
    text-align: center;
    text-decoration: underline;
    padding-top: 20px;
    color: white;
}

header {
    position: relative;
    z-index: 1000;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.header-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

#sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 300px;
    height: 100vh;
    overflow: hidden;
    transition: transform 0.2s ease-in-out;
    transform: translateX(-100%);
    background-color: #333;
    color: white;
    padding: 10px;
}

#sidebar.show {
    transform: translateX(0);
}

.nav-item {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link {
    color: white;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-link.active {
    color: #ababab;
    background: #404040;
    border-radius: 10px;
}

.nav-link:hover {
    color: #787878;
    background: #2b2b2b;
    border-radius: 10px;
}

.navbar-toggler {
    transition: text-shadow 0.2s ease-in-out;
}

.navbar-toggler:hover {
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.9);
}

html, body {
    height: auto;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #2e2e2e;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

h1, h2, h4, p {
    color: white;
}

.custom-container {
    width: 95%;
    margin: auto;
    flex: 1;
}

.small-dropdown {
    font-size: inherit;
    height: auto;
}

#totalCount {
    color: rgb(103, 103, 103);
    margin: 0;
}

.highlight {
    background-color: #ff7f7f;
}

#sample {
    margin-right: 8px;
    border-radius: 50%;
}

.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.table-responsive {
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

/* Index */
#i-link a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

img {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.content {
    flex-grow: 1;
}

.footer {
    width: 100%;
    text-align: inherit;
    padding: 0 0 5px;
    color: #858585;
    margin-top: auto;
    justify-content: space-between;
    align-items: center;
    display: flex;
}

/* Vehicles */
.form-check-label {
    color: white;
}

.form-select.small-dropdown {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: visible;
}

.form-select.small-dropdown optgroup {
    font-weight: bold;
    padding-left: 0 !important;
}

.form-select.small-dropdown optgroup option {
    padding-left: 1.25rem;
}

.form-select.small-dropdown option {
    font-weight: normal;
}

.form-select.small-dropdown option:checked {
    font-weight: bold;
}

.form-select.small-dropdown.active-filter {
    font-weight: bold;
}

.rpo-tag {
    background-color: #f0f0f06a;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

#rpoResults {
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    z-index: 1000;
    width: 100%;
}

#selectedRPOs .rpo-tag {
    font-size: 0.75rem;
}

.stats {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    margin-bottom: 10px;
}

.pagination .page-link {
    background-color: #444;
    color: white;
    border: 1px solid #555;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    min-width: 28px;
    text-align: center;
}

.pagination .page-link:hover {
    background-color: #666;
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: #d1d1d1;
    color: black;
    border-color: #d1d1d1;
    font-weight: bold;
}

.pagination .page-item.disabled .page-link {
    color: #888;
    pointer-events: none;
}

.pagination .page-link:focus,
.pagination .page-link:focus-visible {
    outline: 3px solid #d1d1d1;
}

.table-veh {
    font-size: 0.75rem;
    table-layout: auto;
    width: 100%;
}

.table-veh thead th {
    background-color: #2e2e2e;
    color: #fff;
    border-bottom: 2px solid #000;
    padding: 10px;
}

.table-veh td, .table-veh th {
    border: 1px solid #dee2e6;
    vertical-align: middle;
    text-align: center;
    padding: 5px;
    white-space: nowrap;
}

.table-veh th .dropdown-container {
    display: block;
    width: 100%;
}

.table-veh tbody tr {
    transition: background-color 0.3s ease;
}

.table-veh tbody tr:nth-child(odd) {
    background-color: #ececec;
}

.table-veh tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.table-veh tbody tr:hover {
    background-color: #cacaca;
}

.sortable {
    transition: color 0.2s ease, background-color 0.2s ease;
}

.sortable:hover {
    color: rgb(152, 152, 152);
    background: #4a4a4a;
}

#filterToggle {
    padding: 0.5rem;
    display: inline-flex;
    cursor: pointer;
}

#filterContent {
    overflow: hidden;
    max-height: 0;
}

#filterContent.show {
    max-height: 1000px;
}

#filterIcon {
    color: white;
    margin-left: 0.6rem;
    transition: transform 0.1s ease-out;
    transform: rotate(-90deg);
}

#filterIcon.rotate {
    transform: rotate(0deg);
}

.accounting-format {
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.accounting-format span:first-child {
    margin-right: auto;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Stats */
#barChart {
    max-height: 600px;
    overflow: auto;
    margin-bottom: 20px;
    width: 100%;
    height: 600px !important;
    max-width: 100%;
}

.statsDropdown {
    flex: 1 1 150px;
}

.color-link {
    color: black;
}

/* Search */
#image-warning {
    width: 100%;
    margin-bottom: 2px;
}

.spinner {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #fff;
    border-left: 4px solid #0008ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.flex-row-wrap {
    display: flex;
    gap: 1px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding-bottom: 10px;
}

#image-gallery {
    scroll-snap-type: x mandatory;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: 100%;
    gap: 5px;
    padding: 10px 0;
}

#image-gallery img {
    scroll-snap-align: center;
    display: inline-block;
}

#image-gallery-shimmer {
  display: flex;
  gap: 5px;
  overflow: hidden;
  width: 100%;
  padding: 10px 0;
  justify-content: center;
  align-items: center;
}

#image-gallery-shimmer .shimmer-box {
  width: 100px;
  height: 60px;
  border-radius: 4px;
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to left, #444 8%, #555 18%, #444 33%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  will-change: background-position;
}

#carousel-container {
    box-sizing: border-box;
    flex-basis: 100%;
    flex: 1;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    min-width: auto;
    overflow: hidden;
    position: relative;
}

#carousel-image {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

#prev, #next {
    position: absolute;
    top: 40%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 100;
}

#prev { left: 0;}

#next { right: 0;}

.rarity-container {
    display: flex;
    margin-bottom: 15px;
}

.rarity-btn {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.response-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.response {
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: x-large;
}

#vinTable, #rpoTable {
    max-width: 80%;
    margin: 0 auto;
    table-layout: fixed;
}

#vinTable td, #rpoTable td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-height: 4.5em;
    line-height: 1.5;
    overflow: hidden;
}

#vinTable td:first-child {
    text-align: left;
}

#vinTable td:nth-child(2) {
    text-align: right;
}

#rpoTable td:first-child {
    text-align: center;
    font-weight: bold;
}

#vinTable td:first-child,
#vinTable th:first-child,
#rpoTable td:first-child,
#rpoTable th:first-child {
    width: 25%;
}

#vinTable td:nth-child(2),
#vinTable th:nth-child(2),
#rpoTable td:nth-child(2),
#rpoTable th:nth-child(2) {
    width: 75%;
}

/* Mobile Styles */
@media (max-width: 1150px) {
    /* Universal */
    .custom-container {
        padding: 0 10px;
    }

    .custom-container > .row {
        flex-direction: column !important;
    }

    .form-select {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .form-select.small-dropdown {
        font-size: 0.75rem;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: visible;
    }

    #top-scroll {
        height: 8px;
        pointer-events: auto;
    }

    #top-scroll-wrapper, #bottom-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .footer {
        font-size: 0.75rem;
    }

    .footer .container-fluid {
        display: flex;
    }

    .footer a {
        text-align: right;
    }

    /* Vehicles */
    .form-check {
        margin-bottom: 6px;
    }
    
    #filterToggle h4 {
        font-size: 1rem;
    }
    #filterForm .form-check-input, #filterForm .form-check-label {
        font-size: 0.75rem;
    }

    #filterForm button {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    #filterForm .form-check {
        margin-bottom: 1px;
    }

    .rpo-tag {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    #rpoSearchInput {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    #rpoResults {
        font-size: 0.8rem;
    }

    .stats {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        font-size: 0.75rem;
        gap: 8px;
    }

    .stats p {
        font-size: 0.75rem;
        margin: 0;
        flex-shrink: 1;
    }

    #limitSelect {
        width: auto;
        min-width: 60px;
        font-size: 0.75rem;
        padding: 4px 8px;
        flex-shrink: 0;
    }

    .table-veh {
        display: block;
        overflow-x: auto;
        font-size: 0.65rem;
        width: 100%;
        min-width: max-content;
    }

    .table-veh thead, .table-veh tbody, .table-veh tr {
        width: 100%;
    }

    .table-veh td, .table-veh th {
        padding: 4px 6px;
        white-space: nowrap;
    }

    .table-responsive {
        margin: 0 auto;
        overflow-x: auto;
    }

        #vinTable {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        word-wrap: break-word;
    }

    #vinTable, #rpoTable, #colorTable {
        display: table;
    }

    .dropdown-container select {
        min-width: 130px;
        width: 100%;
        font-size: 0.75rem;
        height: auto;
    }

    .pagination-wrapper {
        justify-content: center;
        padding: 0 5px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        min-width: 28px;
        text-align: center;
    }
    
    .pagination .page-item {
        flex: 0 0 auto;
    }

    /* Search */
    #vinTable td:nth-child(2) {
        text-align: right;
    }

    .flex-row-wrap {
        flex-direction: column;
    }

    /* Stats */
    #barChart {
        height: 400px;
    }
}
