/* css/base.css - Estilos base (< 150 líneas) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray: #6b7280;
    
    /* Fondos */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    
    /* Texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* Bordes */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Navegación inferior */
    --bottom-nav-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Ocultar elementos */
.hidden {
    display: none !important;
}

/* Vistas que necesitan scroll */
#vehiclesView,
#searchView,
#profileView,
#documentosView {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 64px !important; /* Altura del bottom nav */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
}

/* Vista de mapa (mantenida en map.css) */
#mapView {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 64px !important; /* Altura del bottom nav */
    z-index: 1;
}

/* Spinner de carga */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Responsive - No ocultar navegación en landscape */
@media (min-width: 768px) and (orientation: portrait) {
    :root {
        --bottom-nav-height: 64px;
    }
}

@media (orientation: landscape) {
    :root {
        --bottom-nav-height: 48px;
    }
}
