/* css/components.css */

/* =========================================
   1. GALERÍA ESTILO MAMPOSTERÍA (Masonry)
   ========================================= */
.gallery-section {
    padding: var(--space-xl) 5%;
}

.gallery-grid {
    /* CSS Columns para el efecto Masonry */
    column-count: 3;
    column-gap: var(--space-lg);
    width: 100%;
    margin-bottom: var(--space-xl);
}

.gallery-item {
    break-inside: avoid; /* Evita que las imágenes se corten entre columnas */
    margin-bottom: var(--space-lg);
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    display: block; /* Elimina el espacio fantasma debajo de la imagen */
    object-fit: cover;
}

/* =========================================
   2. SUPERPOSICIÓN EN IMÁGENES (Hover Overlay)
   ========================================= */
.overlay {
    position: absolute;
    inset: 0; /* Cubre toda la imagen */
    background: var(--gradient-overlay);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-md);
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* Elementos dentro del overlay */
.overlay-top {
    display: flex;
    justify-content: flex-end;
}

.user-name-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: var(--text-inverse);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.overlay-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Botones flotantes (Copiar y Like) */
.icon-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition-fast), transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    background: var(--color-warm-yellow);
    transform: scale(1.05);
}

.like-btn.liked {
    color: #ff4757; /* Color rojo para el corazón cuando ya tiene like */
}

/* Botón de Cargar Más */
.load-more-container {
    text-align: center;
    margin-top: var(--space-lg);
}

/* =========================================
   3. VENTANA EMERGENTE (Modal de Detalle)
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity var(--transition-normal);
    padding: var(--space-md);
    visibility: visible;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Oculta el contenido a los lectores de pantalla cuando no se usa */
}

.modal-content {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto; /* Permite scroll si el contenido es muy alto */
}

.close-modal {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-md);
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: color var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-layout {
    display: flex;
    flex-wrap: wrap; /* Para diseño responsivo */
}

.modal-image-container {
    flex: 1 1 50%; /* Ocupa la mitad en pantallas grandes */
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.modal-info {
    flex: 1 1 50%;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.category-tag {
    display: inline-block;
    background: var(--color-pastel-green);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
}

.prompt-box {
    background-color: var(--bg-main);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.prompt-box h4 {
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.prompt-box p {
    font-family: monospace; 
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    word-wrap: break-word;
    /* --- NUEVO: Control de altura para Mega-Prompts --- */
    max-height: 150px; 
    overflow-y: auto; 
    padding-right: 10px; /* Espacio para que el scroll no tape el texto */
}

/* =========================================
   4. DISEÑO RESPONSIVO (Media Queries)
   ========================================= */
@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2; /* 2 columnas en tablets */
    }
    .modal-layout {
        flex-direction: column;
    }
    .modal-image-container, .modal-info {
        flex: 1 1 100%;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1; /* 1 columna en móviles */
    }
    .hero-section h1 {
        font-size: 2rem;
    }
}

/* =========================================
   NUEVO ESTILO PARA EL NOMBRE DE USUARIO EN LA GALERÍA
   ========================================= */
   .user-name-badge {
    background-color: #ffffff !important; /* Fondo totalmente blanco */
    color: #000000 !important; /* Texto negro */
    padding: 6px 12px !important; /* Espaciado interno para que no se vea apretado */
    border-radius: 20px !important; /* Bordes redondeados estilo píldora */
    font-weight: bold !important; /* Texto en negrita para que resalte */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important; /* Pequeña sombra para separarlo de la foto */
}

/* =========================================
   OVERLAY SIEMPRE VISIBLE EN LA GALERÍA
   ========================================= */
.gallery-item .overlay {
    opacity: 1 !important; 
    visibility: visible !important;
    
    /* Degradado oscuro arriba y abajo, transparente en el centro */
    background: linear-gradient(
        to bottom, 
        rgba(0,0,0,0.6) 0%, 
        rgba(0,0,0,0) 30%, 
        rgba(0,0,0,0) 70%, 
        rgba(0,0,0,0.7) 100%
    ) !important;
}

/* Efecto al tocar los botones en móviles */
.gallery-item .overlay-bottom button:active {
    transform: scale(0.95);
}

/* =========================================
   DISEÑO DE PERFIL CON FONDO DIFUMINADO (BLUR)
   ========================================= */
   .linktree-style {
    display: flex;
    justify-content: center;
    padding: 0;
    position: relative; /* Necesario para el fondo absoluto */
    overflow: hidden; /* Evita desbordes del blur */
    background: #000; /* Color de respaldo */
}

/* --- Capa de fondo con la foto difuminada --- */
.linktree-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* EL CAMBIO ESTÁ AQUÍ: Usamos una variable CSS en lugar de inherit */
    background-image: var(--bg-foto); 
    background-size: cover;
    background-position: center;
    
    filter: blur(50px); /* El desenfoque fuerte */
    transform: scale(1.4); /* Escala para tapar los bordes transparentes */
    opacity: 0.6; 
    z-index: 1; 
}

/* Aseguramos que la tarjeta esté por encima del fondo */
.linktree-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    min-height: 80vh;
    color: white;
    text-align: center;
    
    /* Eliminamos el fondo negro sólido de la tarjeta para que sea transparente */
    background: transparent; 
    
    /* Agregamos una sombra suave para separarla del fondo difuminado */
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    z-index: 2; /* Por encima del background::before */
}

/* Reajustamos las capas internas para que sigan siendo negras si lo deseas */
.linktree-image-container {
    position: relative;
    width: 100%;
    height: 450px;
    z-index: 2;
}

.linktree-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* El degradado negro que une la foto con el texto suavemente */
.linktree-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
}

.linktree-info {
    position: relative;
    padding: 0 20px 40px 20px;
    
    /* Mantenemos el fondo negro sólido SOLO aquí para que el texto sea legible */
    background: #000000; 
    
    margin-top: -40px;
    z-index: 2;
    border-radius: 40px 40px 0 0; /* Toque opcional: redondeamos la unión con la foto */
}

.linktree-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #ffffff !important; /* Fuerza el color blanco puro */
}

.linktree-subtitle {
    font-size: 1rem;
    color: #aaaaaa;
    margin: 5px 0 20px 0;
    font-weight: 400;
}

.linktree-bio {
    font-size: 0.95rem;
    color: #cccccc;
    line-height: 1.5;
    max-width: 400px;
    margin: 20px auto 0 auto;
    
    /* --- LAS DOS LÍNEAS MÁGICAS --- */
    text-align: center; 
    white-space: pre-wrap; /* Obliga a HTML a respetar los saltos de línea (Enter) */
}

/* Redes Sociales en Círculos Blancos */
.social-circles-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.social-circle-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    text-decoration: none;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.social-circle-btn:hover {
    transform: scale(1.1);
}

/* Botones flotantes (Editar y Compartir) */
.linktree-floating-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.action-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   AJUSTE DE ESPACIADO: MODAL EDITAR PERFIL
   ========================================= */
   .profile-edit-content {
    padding: 30px 40px; /* 30px arriba/abajo, 40px a los lados */
    box-sizing: border-box; /* Evita que el padding deforme el tamaño total */
}

/* En celulares hacemos el colchón un poquito más pequeño para ahorrar espacio */
@media (max-width: 600px) {
    .profile-edit-content {
        padding: 20px 25px; 
    }
}

/* =========================================
   ESTADÍSTICAS DEL PERFIL VIP
   ========================================= */
   .profile-stats-container {
    display: flex;
    justify-content: center;
    gap: 35px; /* Separación entre cada número */
    margin: 30px auto 10px auto;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Una línea sutil para separar */
    max-width: 400px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff; /* Números en blanco puro para resaltar */
}

.stat-name {
    font-size: 0.75rem;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.member-since {
    font-size: 0.85rem;
    color: #777777; /* Gris oscuro para que no robe atención */
    margin-top: 15px;
    margin-bottom: 25px;
    font-style: italic;
}

/* --- ESTILOS DEL TOOLTIP --- */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help; /* Cambia el cursor a un signo de interrogación en PC */
    border-bottom: 1px dotted #555; /* Una línea sutil para indicar que hay info */
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%; /* Aparece arriba del texto */
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    line-height: 1.4;
    text-transform: none; /* Para que el mensaje se lea normal y no en mayúsculas */
    letter-spacing: 0;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
    pointer-events: none; /* Evita que el tooltip estorbe al hacer clic */
}

/* Triangulito del tooltip */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Mostrar al pasar el ratón (PC) */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Soporte para móviles (cuando se toca el elemento) */
@media (max-width: 600px) {
    .tooltip:active .tooltiptext {
        visibility: visible;
        opacity: 1;
    }
}