/* Estilos personalizados para PresionApp */

body {
    background-color: #ffffff;
    color: #212529;
    padding-bottom: 80px; /* Espacio para el bottom navbar */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Bottom Navbar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 70px;
    background: #ffffff;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    padding: 10px 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
    min-width: 60px;
    position: relative;
}

.bottom-nav-item.active {
    color: #0d6efd;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.bottom-nav-item:hover {
    background-color: #f8f9fa;
}

.bottom-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* Botón central mágico */
.bottom-nav-item.magic-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    border: none;
    padding: 0;
}

.bottom-nav-item.magic-button i {
    font-size: 24px;
    margin-bottom: 0;
}

.bottom-nav-item.magic-button span {
    display: none;
}

.bottom-nav-item.magic-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

/* Tarjetas */
.card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    margin-bottom: 16px;
}

.card-body {
    padding: 20px;
}

/* Inputs */
.form-control {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #212529;
    padding: 12px 16px;
    font-size: 16px; /* Previene zoom en iOS */
    border-radius: 12px;
}

.form-control:focus {
    background-color: #ffffff;
    border-color: #0d6efd;
    color: #212529;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-select {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    color: #212529;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 12px;
}

/* Botones */
.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    min-height: 44px;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    border: none;
}

/* Indicadores de estado */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge i {
    font-size: 16px;
}

/* Cámara */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f9fa;
}

.camera-preview {
    width: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px dashed rgba(255,255,255,0.7);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
    pointer-events: none;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
}

.spinner-overlay i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Perfil selector */
.profile-selector {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-selector::-webkit-scrollbar {
    display: none;
}

.profile-chip {
    flex-shrink: 0;
    padding: 10px 20px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #212529;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-chip.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Stats cards */
.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mediciones en historial */
.measurement-item {
    padding: 16px;
    border-radius: 12px;
    background: #f8f9fa;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.measurement-item.normal { border-left-color: #198754; }
.measurement-item.elevated { border-left-color: #ffc107; }
.measurement-item.warning { border-left-color: #fd7e14; }
.measurement-item.danger { border-left-color: #dc3545; }

/* Animaciones */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (min-width: 768px) {
    .container {
        max-width: 480px;
    }
    
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Ocultar input de archivo original */
#camera-input {
    display: none;
}

/* Fix para menú inferior en móviles */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow-x: hidden;
    }
    
    body {
        min-height: 100vh;
        padding-bottom: 90px !important; /* Más espacio para el menú */
    }
    
    .container {
        padding-bottom: 20px;
    }
    
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        z-index: 9999 !important;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15) !important;
    }
}

/* Asegurar que el menú siempre esté visible */
.bottom-nav {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
