/* assets/css/public-profile.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: #fafafa; /* Fondo gris neutro extremadamente limpio y claro */
    color: #171717; /* Texto principal oscuro/antracita */
    padding: 80px 16px 16px 16px; /* Ajustado el padding superior para no ser tapado por la barra fija */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* --- NUEVA BARRA DE NAVEGACIÓN SUPERIOR FIJA --- */
.main-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-bar-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #171717;
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Botón Sándwich */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 20px;
    justify-content: center;
    z-index: 1002;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #171717;
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}

/* Animación de conversión a equis (X) al abrir */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Desplegable del menú */
.nav-overlay-menu {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.03);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 1001;
}

.nav-overlay-menu.active {
    max-height: 320px; /* Incrementado para dar suficiente espacio al botón de cerrar sesión */
}

.nav-links-list {
    list-style: none;
    padding: 8px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-links-list li a {
    display: block;
    padding: 12px 8px;
    color: #404040;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-links-list li a:hover {
    background-color: #f5f5f5;
    color: #171717;
}

/* Contenedor del botón cerrar sesión */
.logout-item-container {
    margin-top: 10px;
    border-top: 1px solid #e5e5e5;
    padding-top: 12px;
}

/* Estilos del botón cerrar sesión (Rojo sutil) */
.nav-links-list li .btn-logout-nav {
    display: block;
    background-color: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    text-align: center;
    padding: 10px 8px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links-list li .btn-logout-nav:hover {
    background-color: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

/* --- PERFIL CONTENEDOR --- */
.profile-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
}

/* Encabezado SOS - Escala de Grises Puros */
.emergency-header {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.sos-badge {
    background-color: #171717; /* Fondo carbón oscuro */
    color: #ffffff; 
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* FOTO DE PERFIL: Con un borde neutro oscuro */
.emergency-header .profile-avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid #171717; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.emergency-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #171717;
    margin-bottom: 4px;
}

.profile-status {
    font-size: 0.9rem;
    color: #525252;
}

/* Tarjetas de Información - Fondo Blanco Puro y Bordes Gris Neutro */
.info-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #171717;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.critical-card {
    border-left: none;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label {
    font-size: 0.75rem;
    color: #737373; /* Gris neutro intermedio para etiquetas */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #171717;
}

/* Grupo sanguíneo destacado en negro puro sutil */
.value.blood {
    color: #000000; 
    font-size: 1.6rem;
    line-height: 1;
    margin-top: 2px;
}

.value.highlight {
    color: #262626;
}

/* Tarjeta con Validación PIN */
.secure-card {
    border: 1px solid #d4d4d4;
    background-color: #ffffff;
}

.secure-notice {
    font-size: 0.85rem;
    color: #525252;
    line-height: 1.4;
    margin-bottom: 14px;
}

.secure-form {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.secure-form input {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    padding: 12px;
    color: #171717;
    font-size: 0.95rem;
    text-transform: uppercase;
    font-weight: 600;
}

.secure-form input:focus {
    outline: none;
    border-color: #171717;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Botón Desbloquear - Gris Neutro Medio */
.secure-form button {
    background-color: #a3a3a3; 
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.secure-form button:hover {
    background-color: #737373;
}

/* Caja del Historial Desbloqueado */
.secure-content-box {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.secure-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-secure {
    font-size: 0.8rem;
    color: #525252;
    font-weight: 600;
}

.value-secure-text {
    font-size: 0.95rem;
    color: #262626;
    line-height: 1.4;
}

.value-text {
    font-size: 0.95rem;
    color: #404040;
    line-height: 1.4;
}

.encrypted-text {
    color: #a3a3a3;
    font-family: monospace;
    letter-spacing: 1px;
}

/* Bloque de Contacto y Botón de Llamada */
.emergency-contact {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
}

.contact-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden; /* Evita cualquier desborde accidental */
}

.contact-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #171717;
}

/* Botón de Llamar - Negro Puro Institucional */
.btn-call {
    background-color: #000000; 
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-call:hover {
    background-color: #262626;
}

.btn-call:active {
    transform: scale(0.98);
}

/* Botón de WhatsApp Verde Corporativo */
.btn-whatsapp {
    background-color: #25D366; 
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none; /* Asegura que si es un tag <a> no se subraye */
}

.btn-whatsapp:hover {
    background-color: #20ba56;
}

.btn-whatsapp:active {
    transform: scale(0.98);
}

/* CORRECCIÓN DE TAMAÑO MÁXIMO FORZADO PARA LA IMAGEN DEL ICONO */
.whatsapp-icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain !important;
    flex-shrink: 0;
}

/* Errores */
.error-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.error-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #171717;
}

.error-card p {
    font-size: 0.95rem;
    color: #737373;
    line-height: 1.5;
    margin-bottom: 24px;
}

.btn-error-home {
    display: inline-block;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-error-home:hover {
    background-color: #262626;
}

/* Pie de página */
.profile-footer {
    text-align: center;
    padding: 16px 0 8px;
}

.profile-footer p {
    font-size: 0.8rem;
    color: #737373;
}

/* Modal de cuenta regresiva */
.call-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(23, 23, 23, 0.6); /* Fondo translúcido gris muy oscuro */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.countdown-content {
    background-color: #ffffff;
    border: 1px solid #d4d4d4;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.alert-icon { 
    font-size: 2.5rem; 
    margin-bottom: 10px;
}

.countdown-content h2 { 
    font-size: 1.4rem; 
    font-weight: 700; 
    margin-bottom: 6px;
    color: #171717;
}

.countdown-number { 
    font-size: 5rem; 
    font-weight: 700; 
    color: #171717; 
    margin: 15px 0; 
    line-height: 1;
}

.countdown-sub { 
    font-size: 0.85rem !important; 
    color: #737373 !important; 
    margin-bottom: 20px; 
    line-height: 1.4;
}

.btn-cancel-call {
    background-color: #f5f5f5;
    color: #525252;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    padding: 12px;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-call:hover {
    background-color: #e5e5e5;
    color: #171717;
}