@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* --- Reset y Base --- */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', sans-serif;
    color: white;
}

body {
    background: url('../img/fondo_coche.jpg') center/cover no-repeat fixed;
    position: relative;
}

*, *::before, *::after {
    box-sizing: border-box; /* Asegura que paddings no rompan el ancho en móvil */
}

.overlay {
    position: fixed;  
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

/* HEADER MINIMALISTA Y ALINEADO */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(17, 24, 39, 0.85); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 100% !important; 
    padding: 0 20px;            
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left, .nav-right {
    flex: 1; 
}

.nav-links {
    flex: 2; 
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Bloque Izquierda: Logo */
.nav-left {
    display: flex;
    justify-content: flex-start;
}

.nav-logo {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Bloque Centro: Navegación */
.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 10px;
    transition: 0.3s ease;
}

.nav-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    background: rgba(59, 130, 246, 0.15);
    color: white;
}

/* Bloque Derecha: Perfil */
.nav-right {
    display: flex;
    justify-content: flex-end;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 4px 4px 15px;
    border-radius: 30px;
    border: 0px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: 0.3s;
}

.profile-pill:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.user-pill-name {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* CARDS Y CONTENIDO */
.card, .vehicle-card {
    position: relative;
    z-index: 2; 
    background-color: rgba(31, 41, 55, 0.7); 
    backdrop-filter: blur(15px);
    border: 0px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.card {
    max-width: 400px;
    margin: 5% auto;
    padding: 2.5rem 2rem;
    width: 90%; /* Para que no toque los bordes en móvil */
}

.vehicle-card {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

input, textarea {
    width: 100%; 
    padding: 0.9rem;
    border: 0px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background-color: rgba(17, 24, 39, 0.4);
    color: white;
    font-size: 0.95rem;
    transition: background 0.3s, transform 0.2s;
}

input:focus {
    background-color: rgba(17, 24, 39, 0.6);
    outline: none;
    transform: scale(1.01);
}

button, .btn-submit {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.text-center { text-align: center; }
.subtitle { display: block; font-size: 0.9rem; color: #94a3b8; margin-bottom: 2rem; font-weight: 400; }
.input-group { margin-bottom: 1.2rem; }
.text-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: #94a3b8; }
.text-footer a { color: #3b82f6; text-decoration: none; font-weight: 700; }
.text-footer a:hover { text-decoration: underline; }

/* Estilo de Alertas */
.alert { padding: 1rem; border-radius: 12px; margin-bottom: 1.5rem; font-size: 0.85rem; text-align: center; }
.alert-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

/* Search Section */
.search-section { max-width: 1200px; margin: 30px auto; padding: 0 4%; }
.search-form { display: flex; gap: 15px; background: rgba(31, 41, 55, 0.6); padding: 15px; border-radius: 20px; backdrop-filter: blur(10px); align-items: center; }
.search-box { flex: 2; }
.filter-box { flex: 1; }
.search-form input, .search-form select { background: rgba(17, 24, 39, 0.4); border: 0px; color: white; padding: 12px; border-radius: 12px; width: 100%; }
.btn-search { flex: 0.5; padding: 12px; background: #3b82f6; border: none; border-radius: 12px; color: white; font-weight: 700; cursor: pointer; transition: 0.3s; }
.btn-search:hover { background: #2563eb; transform: translateY(-2px); }
.btn-clear { color: #94a3b8; text-decoration: none; font-size: 0.85rem; padding: 0 10px; }

/* Ajustes Responsive Básicos */
@media (max-width: 768px) {
    .user-pill-name { display: none; }
    .header-container { padding: 0 15px; }
    .search-form { flex-direction: column; }
    .search-box, .filter-box, .btn-search { width: 100%; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
}
/* === ALTERNATIVA: PUBLICAR SIEMPRE VISIBLE EN MÓVIL === */
@media (max-width: 768px) {
    /* 1. Mantenemos el contenedor de enlaces activo */
    .nav-links {
        display: flex !important;
        gap: 10px;
    }

    /* 2. Escondemos TODOS los enlaces del menú por defecto */
    .nav-links a {
        display: none;
    }

    /* 3. Forzamos que solo el SEGUNDO enlace (Publicar) sea visible */
    .nav-links a:nth-child(2) {
        display: block;
        background: #3b82f6; /* Color azul para que resalte como botón */
        color: white !important;
        padding: 8px 15px !important;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: bold;
    }

    /* 4. Ajuste opcional: esconder el nombre del usuario para que no choque */
    .user-pill-name {
        display: none;
    }
}