/* ==========================================================================
   CHILE RP - DISEÑO "BÓVEDA DE COLECCIONISTA" v2.0
   - Un rediseño completo para una experiencia de inventario de lujo.
   ========================================================================== */

/* --- 1. ESTRUCTURA PRINCIPAL DE LA BÓVEDA --- */
.vault-container {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto para móviles */
    gap: 2rem;
    max-width: 1600px; /* Un poco más ancho para el look de dashboard */
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Layout de dos columnas para pantallas grandes */
@media (min-width: 1024px) {
    .vault-container {
        grid-template-columns: 280px 1fr; /* Sidebar fija y contenido flexible */
    }
}

/* --- 2. SIDEBAR Y PERFIL DE USUARIO --- */
.vault-sidebar {
    background: rgba(22, 27, 34, 0.5); /* Coincide con el glass-panel */
    border: 1px solid var(--border-color);
    border-radius: var(--main-border-radius);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px; /* Se pega debajo de la navbar */
}

.user-profile-card {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary-accent);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
    margin-bottom: 1rem;
    object-fit: cover;
}

.user-profile-card h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0;
    color: var(--text-primary);
}
.profile-rut {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* --- 3. FILTROS DE CATEGORÍA (NUEVO LOOK) --- */
.category-filters {
    display: flex;
    flex-direction: column; /* Vertical en la sidebar */
    gap: 0.5rem;
}

.filter-btn {
    font-family: var(--font-body);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all var(--transition-speed) ease;
}
.filter-btn:before { /* Icono genérico de "bala" */
    content: '●';
    color: var(--border-color);
    transition: color var(--transition-speed) ease;
}

.filter-btn:hover {
    background-color: var(--dark-bg);
    color: var(--text-primary);
}
.filter-btn:hover:before {
    color: var(--text-secondary);
}

.filter-btn.active {
    color: var(--primary-accent);
    font-weight: 700;
}
.filter-btn.active:before {
    color: var(--primary-accent);
    text-shadow: 0 0 10px var(--primary-accent);
}

/* --- 4. CONTENIDO DE LA BÓVEDA Y TARJETAS DE ÍTEMS --- */
.page-header { text-align: left; margin-bottom: 2rem; }
.page-header .page-title { font-size: 3rem; }
.page-header .page-subtitle { margin: 0.5rem 0 0 0; text-align: left; }

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Efecto de entrada para las tarjetas */
.item-card {
    background: linear-gradient(145deg, #181f2a, #10141a);
    border: 1px solid var(--border-color);
    border-radius: var(--main-border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    /* Animación de entrada */
    opacity: 0;
    transform: translateY(20px);
    animation: itemFadeIn 0.5s ease-out forwards;
}

@keyframes itemFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Efecto de hover 3D y brillo */
.item-card {
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.item-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}
.item-card::after { /* El brillo del borde */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px solid transparent;
    border-radius: var(--main-border-radius);
    transition: all 0.4s ease;
    pointer-events: none; /* Importante para no bloquear clicks */
}
.item-card:hover::after {
    border-color: var(--primary-accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.item-image-container {
    width: 100%; aspect-ratio: 16 / 9;
    background-color: var(--dark-bg);
    overflow: hidden;
}
.item-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.item-card:hover .item-image {
    transform: scale(1.05);
}

.item-details { padding: 1.25rem; flex-grow: 1; display: flex; flex-direction: column; }
.item-name { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-primary); }
.item-description { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; flex-grow: 1; }
.item-info { padding-top: 1rem; border-top: 1px solid var(--border-color); }

/* Tags de Estado */
.tag {
    display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; border: 1px solid;
}
.tag-ok { border-color: #28a745; color: #28a745; background-color: rgba(40, 167, 69, 0.1); }
.tag-danger { border-color: #dc3545; color: #dc3545; background-color: rgba(220, 53, 69, 0.1); }
.tag-warning { border-color: #ffc107; color: #ffc107; background-color: rgba(255, 193, 7, 0.1); }

/* Botones de Acción */
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.btn-action, .btn-cancelar {
    font-weight: 600; font-size: 0.8rem; padding: 8px 14px;
    border: 1px solid var(--border-color);
    background-color: var(--dark-bg); color: var(--text-secondary);
    border-radius: 6px; cursor: pointer; flex-grow: 1; text-align: center;
    transition: all var(--transition-speed) ease;
}
.btn-action:hover {
    background-color: var(--primary-accent); color: var(--primary-accent-text); border-color: var(--primary-accent);
}
.btn-cancelar { border-color: #dc3545; color: #dc3545; }
.btn-cancelar:hover { background-color: #dc3545; color: white; }

/* Mensaje de carga */
.loading-message {
    grid-column: 1 / -1; text-align: center;
    font-size: 1.2rem; color: var(--text-secondary); padding: 4rem 0;
}

/* --- Estilos para el Modal de Licencia --- */

.modal-content-license {
    background: #fdfdfd;
    color: #1a1a1a;
    border-radius: 15px;
    width: 100%;
    max-width: 550px;
    padding: 1.5rem;
    font-family: 'Helvetica Neue', sans-serif;
    border: 1px solid #ccc;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.license-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-bottom: 2px solid #b00;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.license-header img {
    height: 40px;
}

.license-header span {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

.modal-content-license h3 {
    text-align: center;
    font-weight: bold;
    background-color: #0033a0;
    color: white;
    padding: 5px;
    margin: 0 -1.5rem 1rem;
    font-size: 1rem;
}

.license-body {
    display: flex;
    gap: 1.5rem;
}

.license-photo-container {
    width: 120px;
    height: 150px;
    border: 2px solid #ccc;
    padding: 4px;
    background: #e9e9e9;
}

.license-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.license-info {
    flex-grow: 1;
}

.info-field {
    margin-bottom: 0.8rem;
}

.info-field label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
}

.info-field span {
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
}

.info-dates {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.modal-content-license .modal-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* --- Estilos para Vehículos con Registro Pendiente --- */
.item-card.pending-registration {
    border-color: #f59e0b; /* Borde ámbar para destacar */
    background-color: #fffbeb;
    color: #92400e;
}
.item-card.pending-registration .item-name {
    color: #b45309;
}
.item-card.pending-registration .pending-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 251, 235, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    
    /* ===> AÑADE ESTA ÚNICA LÍNEA <=== */
    pointer-events: none; 
}
.item-card.pending-registration .pending-overlay i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.item-card.pending-registration .btn-register {
    width: 100%;
    background-color: #f59e0b;
    color: white;
    border: none;
}
.item-card.pending-registration .btn-register:hover {
    background-color: #d97706;
}

/* ===================================================
   ESTILOS DE MODAL (RESTAURADOS)
   =================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    
    /* === CAMBIOS CLAVE AQUÍ === */
    display: none; /* <--- 1. Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex; /* <--- 2. Lo volvemos visible */
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--dark-bg); /* Usamos tus variables CSS */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin: 0;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-body .form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Re-usamos estilos de botones de otros archivos */
.btn-secondary {
    background-color: var(--kenner-surface, #1F2937); /* Fallback por si acaso */
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-accent);
    color: var(--primary-accent-text);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--border-color);
}
.btn-primary:hover {
    background-color: var(--primary-accent-hover);
}


