* {
    -webkit-tap-highlight-color: transparent; 
    -webkit-appearance: none;
    box-sizing: border-box;
}

/* 1. VARIABLES Y CONFIGURACIÓN BASE */
:root { 
    --primary: #5b6236;      /* Verde Musgo */
    --accent: #d96236;       /* Naranja Terracota */
    --bg-beige:#fdf5e6;     /* Crema suave de fondo */
    --text-main: #3d3d29;    /* Texto oscuro */
    --card-bg: #ffffff;
    --danger: #b33939;       /* Rojo alertas */
    --border-light: #e0d8c3; /* Bordes */
}

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background: var(--bg-beige); 
    color: var(--text-main);
    margin: 0; 
    padding: 0;
    display: flex; 
    justify-content: center;
    align-items: flex-start; 
    min-height: 100vh;
}

/* 2. CONTENEDORES Y ESTRUCTURA */
.card { 
    background: var(--bg-beige); 
    width: 100%; 
    max-width: 440px; 
    padding: 20px; 
    text-align: center; 
    min-height: 100vh; 
    position: relative;
    box-sizing: border-box;
    padding-top: 10px;
    padding-bottom: 100px; /* Espacio para el menú fijo */
}

.screen { 
    display: none; 
    animation: fadeIn 0.4s ease-out; 
}
.active { display: block !important; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* 3. TIPOGRAFÍA Y MARCA */
h2, h3 {
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nombre-app-header {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--accent);
    margin: 10px 0 20px 0; 
    letter-spacing: -1px;
    text-transform: lowercase;
}

/* 4. ELEMENTOS DE FORMULARIO */
input, textarea, select { 
    width: 100%; 
    padding: 16px; 
    margin: 10px 0; 
    border: 2px solid var(--border-light); 
    border-radius: 20px; 
    background: white;
    color: var(--text-main);
    box-sizing: border-box; 
    outline: none;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus { border-color: var(--primary); }

button { 
    width: 100%; 
    padding: 18px; 
    background: var(--primary); 
    color: white; 
    border: none; 
    border-radius: 50px; 
    font-weight: bold; 
    font-size: 1em;
    cursor: pointer; 
    transition: transform 0.2s, background 0.3s;
    box-shadow: 0 4px 12px rgba(91, 98, 54, 0.3);
    margin-top: 10px;
}

button:active { transform: scale(0.96); }

.secondary-btn { background: var(--border-light); color: var(--text-main); box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger); border: 2px solid var(--danger); box-shadow: none; }

/* 5. COMPONENTES (Fichas y Mascotas) */
.fila-ficha { 
    display: flex; 
    align-items: center; 
    background: white;
    margin-bottom: 12px;
    padding: 15px 20px; 
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    text-align: left;
    position: relative;
    overflow: hidden;
}

#lista-mascotas, .contenedor-netflix { 
    display: flex !important; 
    flex-wrap: nowrap !important; /* Fuerza a que se mantengan en una sola fila */
    gap: 20px; 
    overflow-x: auto !important; /* Habilita el scroll lateral */
    padding: 15px 10px; 
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone */
    justify-content: flex-start; /* Alinea al inicio para que el scroll funcione */
}

#lista-mascotas::-webkit-scrollbar { display: none; }

.avatar-container {
    width: 70px; /* Lo bajamos de 85 a 70 para que quepa todo en pantalla */
    height: 70px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    padding: 3px;
    background: white;
    margin-bottom: 5px;
    position: relative; /* Por si luego queremos poner un badge encima */
}
.pet-avatar { width: 100%; height: 100%; border-radius: 50%; background-size: cover; background-position: center; }

/* Ajuste para que el nombre y el botón se apilen bien */
.pet-item {
    flex: 0 0 auto; /* CRUCIAL: Evita que las mascotas se achiquen para entrar */
    width: 90px;    /* Ancho fijo para cada columna de mascota */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 6. STATUS Y ALERTAS (SOLO EN PREVIEW) */
.alerta-perdido {
    display: none; /* Escondido por defecto */
    background: #fff5f5;
    border: 2px dashed var(--accent); 
    color: var(--accent);
    padding: 20px;
    border-radius: 20px;
    font-weight: 800;
    margin: 15px 0;
}

.preview-mode .alerta-perdido {
    display: block !important;
    animation: pulso-alerta 2s infinite;
}

@keyframes pulso-alerta {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* 7. MENÚ INFERIOR FIJO */
.fixed-menu { 
    position: fixed; 
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%; max-width: 400px; 
    background: var(--primary); 
    display: flex; 
    padding: 12px 5px; 
    border-radius: 35px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 1000;
}

.menu-item { color: white; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.8em; cursor: pointer; }
.menu-item span { font-size: 1.5rem; }

/* 8. SWITCHES (CORREGIDO: ELIMINA EL BLOQUE GIGANTE) */
/* 8. SWITCHES (Mood vs Público) */

/* 8.1 - ESTILO PARA MODO PERDIDO (El interruptor alargado) */
.switch-mood {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch-mood input {
    opacity: 0; width: 0; height: 0;
    position: absolute;
}

.slider-mood {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider-mood:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-mood input:checked + .slider-mood { 
    background-color: var(--accent); 
}

.switch-mood input:checked + .slider-mood:before { 
    transform: translateX(24px); 
}

/* 8.2 - ESTILO PARA EL MUNDITO (Círculo de Ficha Pública) */
.switch-publico {
   position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 75px; 
    height: 30px;
    background: #e0d8c3;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
    margin-left: 10px;
}

.switch-publico input {
    opacity: 0;
    position: absolute;
}
.label-text {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #8c8573;
}

.icono-qr {
    font-size: 1.2rem;
    filter: grayscale(1); /* Mundito gris por defecto */
    opacity: 0.6;
    transition: 0.3s;
}
.label-text::before { content: "Privado"; }

.switch-publico:has(input:checked) { background: var(--primary); }

.switch-publico:has(input:checked) .label-text { color: white; }

.switch-publico:has(input:checked) .label-text::before { content: "Público"; }

/* Cuando se activa el mundito */
.switch-publico:has(input:checked) {
    background-color: var(--primary); /* Cambia a tu verde */
    transform: scale(1.1);
}

.switch-publico:has(input:checked) .icono-qr {
    filter: grayscale(0); /* Recupera color */
    opacity: 1;
}

/* 9. FOTO Y BADGE (SOLO EN PREVIEW) */
.header-foto, .status-badge {
    display: none !important; /* Escondido en todas las pantallas */
}

#pantalla-preview-qr.active .header-foto {
    display: block !important;
    width: 100%; 
    height: 250px; 
    background-size: cover; 
    background-position: center; 
    border-radius: 0 0 40px 40px; 
    margin-bottom: 20px;
    position: relative;
}

#pantalla-preview-qr.active .status-badge {
    display: block !important;
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}

/* 10. EXTRAS */
.logo-container img { max-width: 160px; margin: 20px auto; display: block; }

.menu-perfil {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.btn-destacado {
    background: var(--accent) !important;
    border-bottom: 4px solid #b34e2b !important;
}

.toast { 
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
    background: var(--text-main); color: white; padding: 14px 28px;
    border-radius: 50px; z-index: 10000; transition: 0.5s;
}
.toast.show { top: 30px; }

/* 11. ESTILOS VISTA PÚBLICA (QR) */
.alerta-medica {
    background: #fff3cd; /* Amarillo suave tipo advertencia */
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
    color: #856404;
    font-size: 0.9em;
    text-align: left;
    line-height: 1.4;
}

.dato-preview {
    border-bottom: 1px solid #e0d8c3;
    padding: 12px 0;
    margin: 0;
    text-align: left;
    font-size: 1.1em;
}

.dato-preview b {
    color: var(--primary); /* El verde musgo para las etiquetas */
    text-transform: uppercase;
    font-size: 0.8em;
    display: block; /* Pone la etiqueta arriba del dato */
    margin-bottom: 2px;
}

/* Contenedor de botones en fila */
.botones-contacto-qr {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 0 10px;
}

/* Estilo base para ambos botones */
.btn-qr-accion {
    flex: 1;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-weight: bold;
    color: white;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.btn-qr-accion:visited, .btn-qr-accion:active {
    transform: scale(0.97);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* Colores específicos que transmiten confianza */
.btn-whatsapp {
   background-color: #25D366 !important;
}

.btn-llamar {
    background-color: #007AFF !important; /* Azul oficial llamadas/iOS */
}

.icono-btn {

    font-size: 18px;
}
/* Estilos para la Agenda en el Home */
.agenda-home {
    margin-top: 20px;
    background: #fdfbf7; /* Fondo sutil */
    padding: 15px;
    border-radius: 15px;
}

.tabla-recordatorios {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-top: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.fila-rec {
    background: white;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Centrado vertical del botón respecto al texto */
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.fila-rec:last-child {
    border-bottom: none;
}

.rec-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.rec-titulo {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.rec-detalle {
    font-size: 11px;
    color: #8c8573;
    margin-bottom:1px;
}
.rec-fecha-info {
    font-size: 10px; /* Letra bien chica para fecha y hora */
    color: #a39b88;
}

.btn-borrar-rec {
    /* 1. Lo más importante: obliga al botón a medir lo mismo que su texto */
    display: inline-block !important; 
    width: auto !important;
    min-width: 0 !important;

    /* 2. Color y fondo */
    background: #fff0f0 !important;
    color: #ff5c5c !important;
    border: 1px solid #ffebeb !important;

    /* 3. ACHICAR EL BORDE AL MÁXIMO */
    /* El primer número es arriba/abajo, el segundo es izquierda/derecha */
    padding: 1px 4px !important; 
    
    /* 4. Tipografía compacta */
    font-size: 10px !important;
    line-height: 1 !important; /* Evita que el botón crezca hacia arriba */
    font-weight: bold !important;
    text-transform: uppercase;
    
    border-radius: 3px !important;
    cursor: pointer;
    vertical-align: middle;
}

.btn-borrar-rec:active {
   background:#ffeded;
    transform: scale(0.95);
}

.pantalla-home h3 {
    font-size: 10px;
    letter-spacing: 1px;
    color: #8c8573;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-align: center;
}
/* Pildorita Editar en el Home */
.btn-editar-pildora {
    background: #e8f5e9 !important; /* Verde muy suave */
    color: #2e7d32 !important;     /* Verde oscuro */
    border: 1px solid #c8e6c9 !important;
    
    display: inline-block !important;
    padding: 2px 8px !important;
    margin-top: 6px !important;
    
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    
    
    cursor: pointer;
    transition: all 0.2s;
    width: auto !important; /* Evita que ocupe todo el ancho */
    min-width: 0 !important;
    line-height: 1.2 !important;
}

.btn-editar-pildora:active {
    background: #c8e6c9 !important;
    transform: scale(0.95);
}

/* Contenedor del Mapa */
.map-container {
    position: relative;
    width: 100%;
    height: 450px; /* Ajusta según el alto de tu pantalla */
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

#map {
    width: 100%;
    height: 100%;
    background-color: #e5e3df; /* Color de carga antes de que aparezca el mapa */
}

/* Contenedor de Botones Flotantes */
.map-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 15px;
    z-index: 5;
}

/* Estilo Píldora Flotante */
.btn-map-pill {
    flex: 1;
    background: white !important;
    color: var(--text-main) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 12px 5px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    margin: 0 !important;
    transition: all 0.2s;
}

.btn-map-pill span { font-size: 16px; }

/* Colores de acento al presionar */
.btn-urgencias:active { background: #fff5f5 !important; color: var(--danger) !important; transform: scale(0.95); }
.btn-ocio:active { background: #f0f7f0 !important; color: var(--primary) !important; transform: scale(0.95); }
