/* css/main.css */

/* =========================================
   1. RESETEO BÁSICO Y TIPOGRAFÍA
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Clases de utilidad para fondos */
.bg-light { background-color: var(--bg-main); }
.gradient-bg { background: var(--gradient-primary); }
.hidden { display: none !important; }

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

a:hover { color: var(--color-pastel-green-hover); }

/* =========================================
   2. BOTONES GLOBALES
   ========================================= */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary); /* Texto oscuro para contrastar con el pastel */
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-pastel-green);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--color-pastel-green);
}

/* =========================================
   3. BARRA DE NAVEGACIÓN (Navbar)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 5%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px); /* Efecto cristal moderno */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar nav {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-link {
    font-weight: 400;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* =========================================
   4. SECCIÓN HERO (Inicio)
   ========================================= */
.hero-section {
    padding: 80px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-portrait {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 4px solid var(--bg-card);
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.hero-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

/* =========================================
   5. CONTROLES Y TESTIMONIOS
   ========================================= */
.controls-section {
    padding: var(--space-lg) 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.search-bar {
    display: flex;
    width: 100%;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    outline: none;
    font-family: inherit;
}

.search-bar button {
    padding: 12px 20px;
    background: var(--color-pastel-green);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: background var(--transition-fast);
}

.search-bar button:hover {
    background: var(--color-pastel-green-hover);
}

.filters {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.testimonials-section {
    padding: 60px 5%;
    background-color: var(--bg-card);
    text-align: center;
}

.testimonials-grid {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.testimonial-card {
    background: var(--bg-main);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    max-width: 400px;
    box-shadow: var(--shadow-sm);
    font-style: italic;
    color: var(--text-secondary);
}

.testimonial-card span {
    display: block;
    margin-top: var(--space-sm);
    font-weight: 600;
    font-style: normal;
    color: var(--text-primary);
}

/* =========================================
   6. PIE DE PÁGINA (Footer)
   ========================================= */
.footer-section {
    padding: 40px 5%;
    color: var(--text-primary);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    font-weight: 600;
}

/* =========================================
   7. PERFIL DE USUARIO
   ========================================= */
.profile-header {
    padding: var(--space-xl) 5%;
    display: flex;
    justify-content: center;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    max-width: 900px;
    width: 100%;
    /* Efecto cristal para que resalte sobre el gradiente */
    background: rgba(255, 255, 255, 0.4); 
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.profile-avatar-wrapper {
    flex-shrink: 0;
}

/* Hace que tu foto de perfil sea completamente redonda */
.profile-avatar-wrapper img {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--bg-card);
    box-shadow: var(--shadow-md);
}

.profile-info {
    flex: 1;
    min-width: 250px;
}

.profile-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-weight: 400;
}

.profile-description {
    margin-bottom: var(--space-md);
    max-width: 600px;
}

.profile-links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-sm);
}

.profile-actions {
    display: flex;
    align-items: flex-start;
}

.user-gallery-section {
    padding: var(--space-xl) 5%;
}

.section-title {
    margin-bottom: var(--space-lg);
    text-align: center;
}

/* Ajustes para dispositivos móviles */
@media (max-width: 768px) {
    .profile-container {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-links, .profile-actions {
        justify-content: center;
        width: 100%;
    }
}

/* =========================================
   ESTILOS PARA TARJETAS DE TESTIMONIOS
   ========================================= */
   .testimonial-header {
    display: flex;
    align-items: center;
    gap: 15px; /* Separación entre la foto y el texto */
    margin-bottom: 15px; /* Separación entre el encabezado y el comentario */
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Esto hace que la foto sea un círculo perfecto */
    object-fit: cover;
    border: 2px solid var(--border-color, #eaeaea);
}

.testimonial-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.testimonial-info span {
    font-size: 0.85rem;
}

.testimonial-card p {
    font-style: italic;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* =========================================
   SCROLL HORIZONTAL PARA LOS FILTROS
   ========================================= */
   /* =========================================
   CONTENEDOR DE FILTROS (DISEÑO NUBE DE ETIQUETAS)
   ========================================= */
.filters-container {
    display: flex;
    flex-wrap: wrap; /* MAGIA: Si el botón choca con el borde, salta abajo */
    justify-content: center; /* Centra los botones para que se vea ordenado */
    gap: 10px; /* Espacio entre cada botón */
    margin-bottom: 25px;
    width: 100%;
}

/* Reducimos un poquito el tamaño de los botones solo en móviles para que quepan más por línea */
@media (max-width: 768px) {
    .filters-container {
        gap: 8px; /* Juntamos un poquito más los botones */
    }
    
    .filter-btn {
        font-size: 0.85rem; /* Letra un poco más pequeña */
        padding: 6px 14px; /* Botón menos "gordo" */
        flex-grow: 1; /* Hace que los botones se estiren ligeramente para rellenar los huecos vacíos */
        text-align: center;
    }
}

/* Ocultar la barra de scroll gruesa para que se vea limpio y profesional */
.filters-container::-webkit-scrollbar {
    height: 4px;
}
.filters-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color, #ccc);
    border-radius: 10px;
}

/* =========================================
   1. PROTECCIÓN GLOBAL ANTI-ZOOM
   ========================================= */
   html, body {
    overflow-x: hidden; /* Esto elimina mágicamente el scroll horizontal indeseado */
    width: 100%;
    margin: 0;
    padding: 0;
}

*, *::before, *::after {
    box-sizing: border-box; /* Evita que los márgenes rompan el ancho de la pantalla */
}

img {
    max-width: 100%; /* Obliga a las imágenes a nunca salirse de su caja */
    height: auto;
}

/* =========================================
   2. ADAPTACIÓN PARA MÓVILES (iPhone, Android)
   ========================================= */
@media (max-width: 768px) {
    
    /* A. El Menú (Navbar) */
    .navbar {
        flex-direction: column; /* Pone el logo arriba y los botones abajo */
        padding: 15px;
        gap: 15px;
        text-align: center;
    }
    
    .navbar nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    /* B. Sección Hero (El título principal) */
    .hero-section {
        padding: 40px 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem !important; /* Achica el texto para que no se desborde */
    }

    /* C. Galería de Imágenes */
    .gallery-grid {
        /* Fuerza a que sean 2 fotos por fila en el iPhone, en lugar de amontonarse */
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px;
        padding: 10px;
    }

    /* D. Testimonios */
    .testimonials-grid {
        /* En el celular se lee mejor 1 testimonio debajo del otro */
        grid-template-columns: 1fr !important; 
    }

    /* E. La Ventana Emergente (Modal) */
    .modal-layout {
        flex-direction: column; /* Pone la foto arriba y el texto abajo */
    }
    
    .modal-content {
        width: 95%; /* Que ocupe casi toda la pantalla del iPhone */
        margin: 10% auto;
        max-height: 85vh;
        overflow-y: auto; /* Permite hacer scroll dentro de la ventanita */
    }

    /* F. Los botones sobre la imagen */
    /* F. Los botones sobre la imagen (Corregido para iPhone) */
    .gallery-item .overlay-bottom {
        flex-direction: row; /* Los mantiene en línea horizontal */
        justify-content: space-between; /* Empuja uno a cada esquina */
        align-items: center;
        width: 100%; /* Asegura que ocupen todo el ancho disponible */
    }
}

/* Ajuste extra para pantallas AÚN más pequeñas (como el iPhone SE) */
@media (max-width: 480px) {
    .gallery-grid {
        /* Si la pantalla es diminuta, pone 1 sola foto en grande */
        grid-template-columns: 1fr !important; 
    }
}

/* =========================================
   NOTIFICACIONES FLOTANTES (TOASTS)
   ========================================= */
   .custom-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Empieza oculto abajo */
    background: var(--bg-card, #ffffff);
    color: var(--text-color, #333333);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Animación de rebote suave */
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--primary-color, #7928ca); /* Línea de color de tu marca */
}

/* Clase que se agrega con JS para mostrarlo */
.custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================
   MODAL DE AUTENTICACIÓN
   ========================================= */
   .auth-modal-content {
    max-width: 400px !important; /* Más angosto que el modal de imágenes */
    padding: 30px 25px !important;
    text-align: center;
    border-radius: var(--radius-lg, 12px);
}

.auth-modal-body h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-color, #333);
}

.auth-modal-body p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary-color, #7928ca);
    margin-bottom: 15px;
    background: rgba(121, 40, 202, 0.1);
    padding: 20px;
    border-radius: 50%;
}

/* Accesibilidad: Indicador de foco solo cuando se navega con teclado */
*:focus-visible {
    outline: 3px solid var(--color-pastel-green);
    outline-offset: 2px;
}

/* Accesibilidad: Respetar preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Scrollbar global estilo App */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}