/* === ESTILOS GENERALES Y RESET === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #f4f8fa; /* (gris azulado claro fondo) */
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
    flex-grow: 1;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* (img: evitar espacio extra, ayuda centrar) */
}

/* === HEADER, NAV, FOOTER === */
header {
    background-color: #ffffff; /* (header: fondo blanco) */
    color: #333333;           /* (header: texto oscuro) */
    padding: 1rem 1rem;       /* (padding razonable) */
    text-align: center;       /* (IMPORTANTE: centrar inline-block logo) */
    border-bottom: 1px solid #eeeeee; /* (borde inferior sutil) */
}

#logo-principal {
    max-width: 100px;         /* (logo: ajustar tamaño) */
    height: auto;             /* (logo: mantener proporción) */
    margin-bottom: 0.25rem;   /* (logo: margen inferior si texto) */
    display: inline-block;    /* (logo: inline-block para centrar/márgenes; nota centrar <a>) */
}

/* (header: H1/P directos) */
header h1 {
    color: #333333;
    margin: 0.5rem 0 0.25rem 0; /* (header h1: ajuste margen) */
    font-size: 2em;
}
header p {
    color: #555555; /* (header p eslogan: gris más claro) */
    margin-top: 0;
    font-size: 1em;
    opacity: 0.9;
}

nav {
    background-color: #008FCF; /* (nav: celeste logo) */
    padding: 0.8rem 1rem;
    text-align: center;
    margin-bottom: 25px;
}
nav a {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 15px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
nav a:hover {
    color: white;
    text-decoration: none;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9em;
    width: 100%;
}

/* === FORMULARIOS === */
.form-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 35px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 0.95em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* === BOTONES === */
button, input[type="submit"] {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, opacity 0.2s ease;
    font-weight: bold;
    color: white;
    text-align: center;
    vertical-align: middle;
}
button:hover {
    opacity: 0.85;
}
button:active {
    transform: scale(0.98);
}

.form-group button[type="submit"] {
    width: 100%; /* (form-group button submit: ancho 100% defecto) */
}

/* (botones: colores específicos por ID form) */
#registration-form button[type="submit"] {
    background-color: #5cb85c;
}
#login-form button[type="submit"] {
    background-color: #4a90e2;
}
#add-pet-form button[type="submit"] {
    background-color: #E8652F;
    width: auto; /* (botón add-pet: ancho auto) */
}
#edit-profile-form button[type="submit"] {
    background-color: #E8652F; /* (botón edit-profile: naranja logo) */
    width: auto; /* (botón edit-profile: ancho auto) */
}
#finder-contact-form button[type="submit"] {
    background-color: #28a745; /* (botón finder-contact: verde) */
    /* width: 100%; /* (hereda, innecesario) */
}
#finder-contact-form button[type="submit"]:hover { /* (hover específico si necesario) */
    background-color: #218838;
    opacity: 1;
}


/* (form enlaces: 'ya tienes cuenta?') */
.login-link, .register-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9em;
}

/* === MENSAJES (ÉXITO/ERROR) === */
.message {
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    display: none; /* (mensajes: ocultos inicio) */
    border: 1px solid transparent;
    font-size: 0.95em;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* === INICIO (HERO) === */
.hero {
    text-align: center;
    padding: 50px 25px;
    background-color: #ffffff;
    border-radius: 8px;
    margin-bottom: 35px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.hero h1 {
    margin-bottom: 15px;
    font-size: 2em;
    color: #333;
    font-weight: 600;
}
.hero p {
    margin-bottom: 30px;
    color: #555;
    font-size: 1.1em;
}
.cta-buttons {
    text-align: center;
}
.cta-buttons button { /* (hero botones: específicos) */
    background-color: #E8652F;
    color: white;
    padding: 12px 25px;
    margin: 8px;
    font-size: 1.05rem;
}

/* === PANEL USUARIO === */
.welcome-msg {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 35px;
    color: #555;
}
.panel-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 35px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
.panel-section h2 {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 25px;
    color: #008FCF;
    font-size: 1.5em;
    font-weight: 600;
}
.visibility-prefs-user label, .visibility-prefs-pet label { /* (labels: para editar_perfil.php) */
    display: inline-block;
    margin-left: 5px;
    font-weight: normal;
}

/* (Lista Mascotas / Escaneos) */
.pet-list, .scan-list { list-style: none; padding: 0; }
.pet-list li, .scan-list li {
    border-bottom: 1px solid #f1f1f1;
    padding: 18px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.pet-list li:last-child, .scan-list li:last-child { border-bottom: none; } /* (último li: sin borde inf) */
.pet-list img.pet-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #eee;
}
.pet-info { flex-grow: 1; min-width: 150px; }
.pet-info strong { font-size: 1.15em; display: block; margin-bottom: 3px; color: #333;}
.pet-info small { color: #777; font-size: 0.85em; display: block; line-height: 1.4;}
.pet-status {
    margin-left: auto; /* (status: alinear derecha) */
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}
.pet-status.active { background-color: #d4edda; color: #155724; }
.pet-status.inactive { background-color: #f8d7da; color: #721c24; }

.scan-list li { align-items: baseline; } /* (scan-list li: alinear baseline) */
.scan-list .scan-time { color: #343a40; font-weight: bold; margin-right: 15px; font-size: 0.9em;}
.scan-list .scan-details { flex-grow: 1; }
.scan-list .scan-pet-name { font-weight: bold; color: #008FCF;}
.scan-list .scan-location { color: #6c757d; font-size: 0.85em; margin-left: 15px; }
.scan-list .scan-location a { color: #008fcf; }

/* === PERFIL PÚBLICO MASCOTA === */
.profile-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 30px;
  max-width: 450px;
  margin: 20px auto 40px auto; /* (profile-card: margen sup/inf ajustado) */
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* (H1 "Firulais Tag" en header global, no aquí) */
.profile-card h2 { /* (profile-card h2: nombre mascota) */
    text-align: center;
    margin-bottom: 25px;
    color: #008fcf;
    font-weight: 600;
    font-size: 1.8em;
}
.profile-pic {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 25px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.info-section p { margin: 12px 0; line-height: 1.6;}
.info-section strong { color: #495057; }
.contact-info {
    margin-top: 30px;
    background-color: #e7f3fe; /* (contact-info: fondo azul claro) */
    padding: 25px;
    border-radius: 5px;
    border: 1px solid #bce0fd;
}
  .contact-info p { margin: 10px 0; }
  .contact-info strong { display: block; margin-bottom: 6px; color: #0056b3; font-size: 1.05em;}
  .contact-info a { color: #0056b3; font-weight: bold;}

/* (contact-finder/location-sharing) */
.contact-finder-form, .location-sharing-section { /* (.location-sharing-section: no usada, posible reutilización) */
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
}
.contact-finder-form h3, .location-sharing-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}
#location-message { margin-top: 15px; font-size:0.9em; } /* (#location-message: div podría usarse para mensajes) */


/* === MEDIA QUERIES (MÓVILES) === */
@media (max-width: 768px) {
    .container {
        margin-left: 0;
        margin-right: 0;
        padding-left: 10px;
        padding-right: 10px;
        width: 100%; /* (móvil container: ancho 100%) */
    }
    .form-container, .profile-card, .panel-section {
        margin-left: 10px;
        margin-right: 10px;
        padding: 20px; /* (móvil containers: menos padding) */
    }
    header { padding: 0.8rem 0.5rem; } /* (móvil header: menos padding) */
    header h1 { font-size: 1.6em; }
    header p { font-size: 0.9em; }
    #logo-principal { max-width: 80px; } /* (móvil logo: más pequeño) */

    nav a { margin: 0 8px; font-size: 0.9em;}
    .panel-section h2 { font-size: 1.3em; }
    .hero h1 { font-size: 1.8em; }

    .pet-list li, .scan-list li {
        flex-direction: column; /* (móvil listas: column) */
        align-items: flex-start; /* (móvil listas: alinear inicio) */
        gap: 8px;
    }
    .pet-list img.pet-photo { margin-right: 0; margin-bottom: 10px;}
    .pet-status { margin-left: 0; margin-top: 10px; } /* (móvil pet-status: debajo) */
    .scan-list .scan-location { margin-left: 0; margin-top: 5px;}
}