:root {
    /* Paleta de Colores Principales */
    --color-base: #4a618a;
    --color-base-light: #1E2D3B; /* Para hover en header */
    --color-link-default: #0071c1;
    --color-texto-tab: #444;
    --color-fondo-blanco-opaco: rgba(255, 255, 255, 0.75);
    /* Colores de Botones y Enfasis Primario */
    --color-btn-primario-fondo: #1b6ec2;
    --color-alerta-success: #26b050; /* Valid */
    --color-alerta-error: red; /* Invalid & Validation Message */
    /* Gradientes del Header Sticky */
    --gradiente-sticky-base: linear-gradient( 270deg, #4a618a, #566f9c, #3f567d, #1E2D3B );
    --gradiente-sticky-scrolled: linear-gradient( 270deg, #1E2D3B, #2c3f55, #3a4f6d, #4a618a );
    /* Medidas y Sombras */
    --border-radius-base: 5px;
    --box-shadow-card: 0 10px 25px rgba(0, 0, 0, 0.3);
    --box-shadow-focus: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    --tab-bar-height: 60px;
}

/* --- Estilos Generales --- */

html, body, #app {
    /* Background */
    height: 100%;
    margin: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

    body.login-background {
        background: url('/bg.jpg') no-repeat center center fixed;
        background-size: cover;
    }

/* Establecer el tamaño base en el HTML */
html {
    font-size: 15px;
}

/* Estilos generales para todo el sitio */
body {
    font-size: 1rem;
}

h1 {
    font-size: 2rem;
}

p, .btn {
    font-size: 1rem;
}

html, body {
    font-family: 'Inter', sans-serif;
}

h1:focus {
    outline: none;
}

.titulo {
    color: var(--color-base);
    font-size: 18px;
}

a, .btn-link {
    color: var(--color-link-default);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-alerta-success);
}

.invalid {
    outline: 1px solid var(--color-alerta-error);
}

.validation-message {
    color: var(--color-alerta-error);
}

#blazor-error-ui {
    background-color: var(--color-error-fondo);
}

/* --- Media Queries (Valores en rem ya están relativos a la base) --- */

@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    p, .btn {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    p, .btn {
        font-size: 0.8rem;
    }
}

/* --- 404 Not Found --- */

#notfound {
    font-family: 'Roboto', sans-serif;
    text-align: center;
    background-color: inherit;
    color: #333;
    padding: 50px;
}

    #notfound .container {
        max-width: 800px;
        margin: 0 auto;
    }

    #notfound h1 {
        font-size: 120px;
        color: #e74c3c;
        margin: 0;
    }

    #notfound p {
        font-size: 24px;
    }

    #notfound .button {
        display: inline-block;
        padding: 10px 20px;
        font-size: 18px;
        color: #fff;
        background-color: #3498db;
        text-decoration: none;
        border-radius: var(--border-radius-base);
        margin-top: 20px;
    }

        #notfound .button:hover {
            background-color: #2980b9;
        }

/* --- Card --- */

/* Cards solo para vehículos */
.vehiculo-card {
    display: flex;
    flex: 1 1 auto;
    margin: 4px;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
    background: inherit;
    position: relative;
}

    /* Imagen dentro de la card */
    .vehiculo-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Shine animado encima de la imagen */
    .vehiculo-card::after {
        content: "";
        position: absolute;
        top: 0;
        left: -75%;
        width: 50%;
        height: 100%;
        background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
        transform: skewX(-25deg);
        opacity: 0.15;
        pointer-events: none;
        animation: shine 4s infinite;
    }

/* Shine animado */
@keyframes shine {
    0% {
        left: -75%;
    }

    100% {
        left: 125%;
    }
}

/* Hover: eleva la card y aumenta sombra */
.vehiculo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1.5rem 2.5rem rgba(0, 0, 0, 0.3);
}

    .vehiculo-card:hover img {
        filter: blur(0);
    }

/* Badge estilo general */
.vehiculo-card .badge {
    font-size: 0.8rem;
    padding: 0.4em 0.6em;
    border-radius: 0.5rem;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}



/* --- Header Sticky --- */

.header-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 9px 15px;
    background: rgba(75, 0, 130, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30), /* sombra inferior más profunda */
    0 0 12px rgba(0, 0, 0, 0.25), /* halo difuso alrededor */
    0 0 2px rgba(255, 255, 255, 0.10) inset; /* leve brillo interior */

    border-bottom: 1px solid rgba(255,255,255,0.25);
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 1000;
    font-weight: 600;
    transition: all 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, background 1s linear;
    pointer-events: auto;
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
    background-image: var(--gradiente-sticky-base);
}

/* Gradiente animado */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Efecto al hacer scroll */
.header-sticky.scrolled {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    background-image: var(--gradiente-sticky-scrolled);
}

/* Títulos y textos con glow */
.header-sticky h1, .header-sticky h2, .header-sticky h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.3);
}

/* Botones e íconos con glow al hover */
.header-sticky .btn, .header-sticky .icon {
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

    .header-sticky .btn:hover, .header-sticky .icon:hover {
        transform: scale(1.1);
        color: var(--color-base-light);
        text-shadow: 0 0 10px var(--color-base-light), 0 2px 6px rgba(0,0,0,0.3);
    }

/* --- Tab Bar (Navegación Inferior) --- */

.tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--color-fondo-blanco-opaco);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--tab-bar-height);
    min-height: var(--tab-bar-height);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.tab-item {
    text-align: center;
    color: var(--color-texto-tab);
    text-decoration: none;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
}

    .tab-item .icon {
        font-size: 20px;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .tab-item .label {
        font-size: 12px;
        margin-top: 2px;
        transition: font-weight 0.3s ease, color 0.3s ease;
    }

    .tab-item:hover {
        color: var(--color-base);
        transform: translateY(-3px);
    }

        .tab-item:hover .icon {
            transform: scale(1.1);
        }

    .tab-item.active {
        color: var(--color-base);
        font-weight: 700;
    }

    .tab-item::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: transparent;
        transition: background-color 0.3s ease, transform 0.3s ease;
    }

    .tab-item.active::after {
        background-color: var(--color-base);
        transform: translateX(-50%) scale(1.2);
    }

/* Opcional: efecto al hacer scroll: fondo más transparente */
.tab-bar.scrolled {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
}

/* --- Botón de Subir (Scroll to Top) --- */

#boton-subir {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + 10px); /* 70px que es 60px (tab-bar) + 10px */
    right: 20px;
    display: none; /* Oculto por defecto */
    padding: 10px 15px;
    background-color: var(--color-base);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease;
}

    #boton-subir:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
    }

/* --- Autocompletar --- */

.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 2px;
    padding: 0;
    list-style-type: none;
    z-index: 1100;
}

    .autocomplete-suggestions li {
        padding: 5px;
        cursor: pointer;
    }

        .autocomplete-suggestions li:hover {
            background-color: var(--color-base);
            color: white;
        }

/* --- Loading Progress --- */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--color-btn-primario-fondo); /* Reutiliza el color primario del botón */
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Cargando");
    }

code {
    color: #c02d76;
}
