/* TRIBU COLAB - DISEÑO MODERNO Y ÚNICO */

/* Container principal */
.tribu-colab-container {
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    min-height: 100vh;
    margin: -2rem -2rem 0 -2rem; /* Eliminar padding del contenedor padre */
}

/* Hero Section */
.tribu-hero {
    position: relative;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    padding: 2rem 2rem 2rem 2rem;
    text-align: center;
    overflow: hidden;
}

/* Patrón de fondo decorativo */
.tribu-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.tribu-btn-back {
    display: none !important;
}

.tribu-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.tribu-hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    margin: 1rem 0 1rem 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tribu-hero-title i {
    font-size: 2.5rem;
    color: white;
    opacity: 0.95;
}

.tribu-hero-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto 2rem auto;
    line-height: 1.5;
    max-width: 600px;
    padding: 0 2rem;
}

/* Estadísticas */
.tribu-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0 2.5rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tribu-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tribu-stat-item i {
    font-size: 1.75rem;
    color: white;
    opacity: 0.9;
}

.tribu-stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tribu-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.tribu-stat-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tribu-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
}

/* Botón Crear Galería - FAB Flotante */
.tribu-btn-crear {
    position: fixed;
    bottom: 90px; /* Encima del bottom nav */
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    text-decoration: none;
    z-index: 9999 !important;
}

.tribu-btn-crear:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
}

.tribu-btn-crear:active {
    transform: translateY(-1px) scale(1.02);
}

.tribu-btn-crear-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tribu-btn-crear-icon i {
    font-size: 1.5rem;
    color: white;
}

.tribu-btn-crear-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.tribu-btn-crear-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.tribu-btn-crear-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    display: none; /* Ocultar en FAB */
}

/* Contenido de galerías */
.tribu-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 0;
}

/* Secciones */
.tribu-section {
    margin-bottom: 4rem;
}

.tribu-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    border-bottom: 2px solid #f3f4f6;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    width: 100%;
    text-align: left;
}

.tribu-section-header:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.tribu-section-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.tribu-section-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tribu-section-icon i {
    font-size: 1.5rem;
    color: white;
}

.tribu-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.tribu-section-count {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #6b7280;
}

.tribu-section-toggle {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tribu-section-toggle i {
    font-size: 1.5rem;
    color: #6b7280;
    transition: transform 0.3s;
}

/* Grid de galerías */
.tribu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    position: relative;
    z-index: 0;
}

/* Estado colapsado */
.tribu-section.collapsed .tribu-grid {
    max-height: 0 !important;
    margin-top: 0;
}

.tribu-section.collapsed .tribu-section-header {
    margin-bottom: 0;
}

/* Empty state especial */
.tribu-empty-state {
    padding: 5rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.tribu-empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tribu-empty-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 32px;
    opacity: 0.2;
    z-index: -1;
}

.tribu-empty-icon i {
    font-size: 4rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tribu-empty-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.tribu-empty-description {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.tribu-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.tribu-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.tribu-empty-btn i {
    font-size: 1.25rem;
}

/* Cards de galería Tribu Colab - Diseño mejorado */
.galeria-tribu-colab-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    z-index: 1;
}

.galeria-tribu-colab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
    z-index: 2;
}

/* Forzar z-index bajo para badges dentro de tarjetas Tribu Colab */
.galeria-tribu-colab-card .galeria-badge,
.galeria-tribu-colab-card .galeria-counter {
    z-index: 1 !important;
}

.galeria-tribu-colab-card .galeria-image-wrapper {
    z-index: 0;
}

/* Botón de editar galería */
.btn-edit-galeria {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 3;
}

.btn-edit-galeria:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

.btn-edit-galeria i {
    font-size: 1.25rem;
    color: white;
}

/* Menú de opciones */
.tribu-modal-menu {
    max-width: 400px;
}

.menu-opciones {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-opcion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.menu-opcion:hover {
    background: #f9fafb;
    border-color: #8b5cf6;
}

.menu-opcion i {
    font-size: 1.5rem;
    color: #6b7280;
    flex-shrink: 0;
}

.menu-opcion span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.menu-opcion-primary {
    background: white;
    border-color: #e5e7eb;
}

.menu-opcion-primary:hover {
    background: #f9fafb;
    border-color: #8b5cf6;
}

.menu-opcion-primary i {
    color: #8b5cf6;
}

.menu-opcion-primary span {
    color: #1f2937;
}

.menu-opcion-danger {
    border-color: #fecaca;
}

.menu-opcion-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.menu-opcion-danger i {
    color: #ef4444;
}

.menu-opcion-danger span {
    color: #dc2626;
}

.menu-opcion-share:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
}

.menu-opcion-share i {
    color: #3b82f6;
}

.menu-opcion-share span {
    color: #1f2937;
}

.menu-opcion-share:hover span {
    color: #2563eb;
}

/* Warning de eliminación */
.delete-warning {
    text-align: center;
    padding: 1.5rem;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.delete-warning i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.delete-warning p {
    font-size: 0.9375rem;
    color: #1f2937;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.delete-warning strong {
    color: #dc2626;
    font-weight: 700;
}

.delete-warning-note {
    font-size: 0.8125rem !important;
    color: #6b7280 !important;
    margin-top: 1rem !important;
}

/* Botón de eliminar */
.btn-tribu-delete {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #ef4444;
    color: white;
}

.btn-tribu-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-tribu-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal de compartir */
.share-info {
    text-align: center;
    padding: 1.5rem;
    background: #f0f9ff;
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.share-info i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.share-info p {
    font-size: 0.9375rem;
    color: #1f2937;
    margin: 0;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
}

.share-url-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1f2937;
    background: #f9fafb;
}

.share-url-container input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
}

.btn-copy-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-copy-url:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-copy-url:active {
    transform: scale(0.95);
}

.btn-copy-url i {
    font-size: 1rem;
    transition: transform 0.3s;
}

/* Animación de éxito al copiar */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Toast centrado personalizado */
.toast-centrado {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}

.toast-centrado.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-centrado i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-centrado span {
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .toast-centrado {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .toast-centrado i {
        font-size: 1.125rem;
    }
}

.galeria-tribu-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.btn-tribu-invite {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.btn-tribu-invite:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-tribu-invite i {
    font-size: 1rem;
}

/* Modal de Tribu Colab */
.tribu-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tribu-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tribu-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.tribu-modal-header-content {
    flex: 1;
}

.tribu-modal-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.modal-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    margin: 0.25rem 0 0 0;
    line-height: 1.2;
}

.tribu-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tribu-modal-close:hover {
    background: #e5e7eb;
}

.tribu-modal-close i {
    font-size: 1.25rem;
    color: #6b7280;
}

.tribu-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Modal body con scroll para modales grandes */
.tribu-modal-large .tribu-modal-body {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    padding: 1.5rem;
    min-height: auto;
}

/* Modal body compacto con scroll cuando hay contenido */
.tribu-modal-body-compact {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem !important;
    max-height: calc(90vh - 200px) !important;
    overflow-y: auto !important;
}

/* Mensaje hint sutil */
.modal-hint {
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.modal-hint-secondary {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0.125rem 0 0.5rem 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    line-height: 1.2;
}

.modal-hint-secondary i {
    font-size: 0.875rem;
}

.btn-with-badge {
    position: relative;
}

.fotos-counter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: #ef4444;
    border-radius: 50%;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.char-counter {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.2s;
}

/* Uploader de portada */
.portada-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portada-preview-desktop {
    width: 100%;
    height: 120px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portada-preview-desktop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portada-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    color: #9ca3af;
}

.portada-placeholder i {
    font-size: 2rem;
}

.portada-placeholder span {
    font-size: 0.8125rem;
    font-weight: 500;
}

.portada-file-info {
    display: none;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.portada-file-info i {
    font-size: 1.25rem;
    color: #16a34a;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    font-size: 0.875rem;
    color: #166534;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-file {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc2626;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-file:hover {
    background: #b91c1c;
}

.btn-remove-file i {
    font-size: 0.875rem;
    color: white;
}

.btn-select-portada {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: #f3f4f6;
    color: #374151;
}

.btn-select-portada:hover {
    background: #e5e7eb;
}

.btn-text-mobile {
    display: none;
}

/* Portada actual */
.portada-actual {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.portada-actual-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.portada-actual-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Modal secundario (no se cierra al hacer clic fuera) */
.tribu-modal-secondary {
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7); /* Más oscuro para distinguir */
}

.tribu-modal-large {
    max-width: 700px;
}

/* Botón más opciones */
.btn-mas-opciones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e5e7eb;
    background: white;
    color: #6b7280;
    margin-top: 0.5rem;
}

.btn-mas-opciones:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #f5f3ff;
}

.btn-mas-opciones i {
    font-size: 1rem;
}

/* Secciones de opciones */
.opciones-section {
    margin-bottom: 2rem;
}

.opciones-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.opciones-section-title i {
    font-size: 1.375rem;
    color: #8b5cf6;
}

/* Opciones de permisos */
.permisos-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.permiso-option {
    display: block;
    cursor: pointer;
}

.permiso-option input[type="radio"] {
    display: none;
}

.permiso-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s;
    background: white;
}

.permiso-option:hover .permiso-content {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.permiso-option.active .permiso-content {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #fae8ff 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.permiso-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.permiso-icon i {
    font-size: 1.5rem;
    color: white;
}

.permiso-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.permiso-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.permiso-description {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Upload de imágenes iniciales */
.imagenes-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.btn-upload-imagenes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload-imagenes:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #8b5cf6;
}

.btn-upload-imagenes i {
    font-size: 1.5rem;
}

.imagenes-preview-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.imagen-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    transition: opacity 0.3s, transform 0.3s;
}

.imagen-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-imagen {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.btn-remove-imagen:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.btn-remove-imagen i {
    font-size: 0.875rem;
    color: white;
}

.imagen-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.375rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: white;
    font-size: 0.6875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .portada-preview-desktop {
        display: none;
    }

    .portada-file-info {
        display: flex;
    }

    .btn-text-desktop {
        display: none;
    }

    .btn-text-mobile {
        display: inline;
    }

    .btn-mas-opciones {
        width: 100%;
    }
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Paleta de colores */
.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    min-height: 36px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.color-option i {
    font-size: 1.125rem;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.color-option.selected i {
    opacity: 1;
}

@media (max-width: 768px) {
    .color-palette-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 0.375rem;
        padding: 0.375rem;
    }
    
    .color-option {
        min-height: 28px;
        border-radius: 4px;
        border-width: 2px;
    }
    
    .color-option i {
        font-size: 0.875rem;
    }
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-info {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.form-info i {
    font-size: 1.125rem;
    color: #16a34a;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.form-info p {
    font-size: 0.8125rem;
    color: #166534;
    margin: 0;
    line-height: 1.5;
}

.tribu-modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 1.5rem;
}

/* Footer fijo del modal */
.tribu-modal-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 2px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.btn-tribu-cancel,
.btn-tribu-submit {
    padding: 0.75rem 1.5rem !important;
    border-radius: 10px;
    font-size: 0.875rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    white-space: nowrap;
}

/* Botones más compactos en modales grandes */
.tribu-modal-large .btn-tribu-cancel,
.tribu-modal-large .btn-tribu-submit {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.875rem !important;
}

.btn-tribu-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-tribu-cancel:hover {
    background: #e5e7eb;
}

.btn-tribu-submit {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-tribu-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-tribu-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-tribu-submit i.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tribu-colab-container {
        margin: -2rem -0.75rem 0 -0.75rem; /* Ajustar para mobile */
    }

    .tribu-hero {
        padding: 1.5rem 1rem 0 1rem;
    }

    .tribu-btn-back {
        top: 1rem;
        left: 1rem;
        width: 36px;
        height: 36px;
    }

    .tribu-hero-title {
        font-size: 2rem;
        gap: 0.5rem;
    }

    .tribu-hero-title i {
        font-size: 1.875rem;
    }

    .tribu-hero-description {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        max-width: 100%;
    }

    .tribu-stats {
        flex-direction: row;
        gap: 1rem;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        border: none;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tribu-stat-divider {
        display: none;
    }

    .tribu-stat-item {
        flex-direction: row;
        gap: 0.375rem;
        align-items: center;
    }

    .tribu-stat-item i {
        font-size: 1.125rem;
    }

    .tribu-stat-content {
        flex-direction: row;
        align-items: baseline;
        gap: 0.25rem;
    }

    .tribu-stat-number {
        font-size: 1.125rem;
    }

    .tribu-stat-label {
        font-size: 0.75rem;
    }

    .tribu-btn-crear {
        bottom: 80px;
        right: 1rem;
        padding: 0;
        width: 56px;
        height: 56px;
        border-radius: 12px;
        justify-content: center;
    }

    .tribu-btn-crear-icon {
        width: auto;
        height: auto;
        background: transparent;
        border-radius: 0;
    }

    .tribu-btn-crear-icon i {
        font-size: 1.75rem;
    }

    .tribu-btn-crear-content {
        display: none;
    }

    .tribu-content {
        padding: 2rem 1rem;
    }

    .tribu-section {
        margin-bottom: 3rem;
    }

    .tribu-section-header {
        padding: 0.75rem;
    }

    .tribu-section-header-left {
        gap: 0.75rem;
    }

    .tribu-section-icon {
        width: 40px;
        height: 40px;
    }

    .tribu-section-icon i {
        font-size: 1.25rem;
    }

    .tribu-section-title {
        font-size: 1.375rem;
    }

    .tribu-section-count {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .tribu-section-toggle {
        width: 32px;
        height: 32px;
    }

    .tribu-section-toggle i {
        font-size: 1.25rem;
    }

    .tribu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Modal principal como bottom sheet en mobile */
    .tribu-modal-overlay:not(.tribu-modal-secondary) {
        align-items: flex-end;
        padding: 0;
    }

    .tribu-modal-overlay:not(.tribu-modal-secondary) .tribu-modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        align-self: flex-end;
        margin: 0;
        animation: slideUpMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    /* Handle del bottom sheet */
    .tribu-modal-overlay:not(.tribu-modal-secondary) .tribu-modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
    }

    .tribu-modal-overlay:not(.tribu-modal-secondary) .tribu-modal-header {
        padding-top: 1.75rem;
        position: relative;
    }

    .tribu-modal-overlay:not(.tribu-modal-secondary) .tribu-modal-body {
        max-height: calc(90vh - 180px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Modal secundario centrado en mobile */
    .tribu-modal-secondary {
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .tribu-modal-secondary .tribu-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px;
        margin: 0;
    }

    .tribu-modal-header {
        padding: 1.25rem;
    }

    .tribu-modal-header h2 {
        font-size: 1.25rem;
    }

    .tribu-modal-body {
        padding: 1.25rem;
    }

    /* Modal body con scroll en mobile */
    .tribu-modal-large .tribu-modal-body {
        max-height: calc(90vh - 160px);
        padding-bottom: 0;
    }

    /* Footer sticky más compacto en mobile */
    .tribu-modal-footer {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
        border-radius: 0;
    }

    .tribu-modal-large .tribu-modal-footer {
        padding: 0.875rem 1rem;
    }

    .tribu-modal-footer .btn-tribu-cancel,
    .tribu-modal-footer .btn-tribu-submit {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        flex: 1;
        max-width: none;
    }

    /* Acciones sticky más compactas en mobile */
    .tribu-modal-large .tribu-modal-actions {
        padding: 0.75rem 1rem;
        margin: 0 -1.25rem -1.25rem -1.25rem;
        gap: 0.5rem;
    }

    .tribu-modal-large .btn-tribu-cancel,
    .tribu-modal-large .btn-tribu-submit {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        flex: 1;
        max-width: none;
    }

    .btn-tribu-invite {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    /* Cards más compactas en mobile */
    .galeria-tribu-colab-card {
        border-radius: 12px;
    }

    .galeria-tribu-colab-card .galeria-content {
        padding: 0.75rem;
    }

    .galeria-tribu-colab-card .galeria-title {
        font-size: 0.9375rem;
    }

    .galeria-tribu-colab-card .galeria-description {
        font-size: 0.8125rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .galeria-tribu-actions {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    /* Botón de editar más pequeño en mobile */
    .btn-edit-galeria {
        top: 0.5rem;
        left: 0.5rem;
        width: 32px;
        height: 32px;
    }

    .btn-edit-galeria i {
        font-size: 1.125rem;
    }
}

/* Lista de álbumes */
.albumes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.albumes-list:empty {
    display: none;
}

.album-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.album-item:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.album-item i {
    font-size: 1.25rem;
    color: #8b5cf6;
    flex-shrink: 0;
}

.album-item span {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-album {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fee2e2;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-album:hover {
    background: #ef4444;
}

.btn-remove-album:hover i {
    color: white;
}

.btn-remove-album i {
    font-size: 0.875rem;
    color: #dc2626;
    transition: color 0.2s;
}

.btn-add-album {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-album:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-add-album i {
    font-size: 1.25rem;
    color: white;
}

/* Ajustes para el campo de clave */
#claveGaleria {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Input para nuevo álbum */
.input-nuevo-album {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: white;
}

.input-nuevo-album:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-nuevo-album::placeholder {
    color: #9ca3af;
}

/* Responsive para álbumes */
@media (max-width: 768px) {
    .albumes-list {
        max-height: 150px;
    }
    
    .album-item {
        padding: 0.625rem;
    }
    
    .album-item span {
        font-size: 0.8125rem;
    }
}

/* Badge de galería privada */
.galeria-badge.privada {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.25);
}

.galeria-badge.privada i {
    font-size: 0.625rem;
}

/* Badge de galería especial/colaborativa */
.galeria-badge.especial {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.25);
}

.galeria-badge.especial i {
    font-size: 0.625rem;
}

/* Badge de galería invitado */
.galeria-badge.invitado {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.4rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 0.5625rem;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    width: auto;
    max-width: fit-content;
    white-space: nowrap;
}

.galeria-badge.invitado i {
    font-size: 0.5625rem;
}

/* Modal compacto (para clave de acceso) */
.tribu-modal-compact {
    max-width: 400px;
}

/* Arreglar alineación del ícono en form-info */
.tribu-modal-compact .form-info {
    align-items: center !important;
}

.tribu-modal-compact .form-info i {
    margin-top: 0 !important;
}

/* Responsive para modal compacto en mobile */
@media (max-width: 768px) {
    /* FORZAR centrado del modal en mobile */
    .tribu-modal-overlay {
        align-items: center !important;
        justify-content: center !important;
    }
    
    .tribu-modal-compact {
        max-width: 90%;
        margin: 0 !important;
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }
    
    .tribu-modal-compact .tribu-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .tribu-modal-compact .form-info {
        padding: 0.875rem !important;
    }
    
    .tribu-modal-compact .form-info p {
        font-size: 0.8125rem !important;
    }
    
    .tribu-modal-compact .form-info i {
        font-size: 1.125rem !important;
    }
}

/* Indicador de error de clave */
.clave-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fee2e2;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #dc2626;
    animation: fadeInError 0.3s ease;
}

.clave-error i {
    font-size: 1rem;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de shake para input incorrecto */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Select personalizado con flecha */
.album-form-group {
    margin-bottom: 1.5rem;
}

.album-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-album {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-album:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #6b7280;
    pointer-events: none;
    transition: transform 0.2s;
}

.select-wrapper:hover .select-arrow {
    color: #8b5cf6;
}

.select-album:focus ~ .select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: #8b5cf6;
}

/* Descripción del álbum */
.album-descripcion {
    margin-top: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.album-descripcion-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    border-left: 3px solid #8b5cf6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #6b21a8;
    line-height: 1.5;
}

.album-descripcion-content i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.album-descripcion-content span {
    flex: 1;
}

/* Modal de crear álbum - estilos específicos */
.album-modal-body {
    padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.album-modal-body .album-form-group input,
.album-modal-body .album-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1f2937;
    transition: all 0.2s;
}

.album-modal-body .album-form-group input:focus,
.album-modal-body .album-form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.album-modal-body .album-form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Acciones del modal de álbum con espacio reducido */
.album-modal-actions {
    margin-top: 0 !important;
    padding: 1rem 1.5rem 1.5rem 1.5rem !important;
}

/* Ajuste del modal cuando el teclado está visible en mobile */
@media (max-width: 768px) {
    .tribu-modal-overlay.keyboard-active {
        align-items: flex-start !important;
        padding-top: 1rem;
    }

    .tribu-modal-overlay.keyboard-active .tribu-modal {
        max-height: 70vh;
        margin-top: 0;
        transform: translateY(0) !important;
    }

    .tribu-modal-overlay.keyboard-active .tribu-modal-body {
        max-height: calc(70vh - 180px);
    }

    /* Asegurar que el input con focus sea visible */
    .tribu-modal-overlay.keyboard-active input:focus,
    .tribu-modal-overlay.keyboard-active textarea:focus {
        scroll-margin-top: 1rem;
    }
}


/* ============================================
   ESTILOS PARA INVITADOS
   ============================================ */

.invitados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.invitados-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.btn-add-invitado {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-invitado:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-add-invitado i {
    font-size: 0.9375rem;
}

.lista-invitados {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.no-invitados {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
}

.invitado-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.invitado-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.invitado-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.invitado-info i {
    font-size: 1.125rem;
    color: #8b5cf6;
}

.invitado-info span {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 500;
}

.btn-remove-invitado {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-invitado:hover {
    background: #fee2e2;
}

.btn-remove-invitado i {
    font-size: 1rem;
    color: #ef4444;
}

.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .invitados-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .btn-add-invitado {
        justify-content: center;
    }
}


/* Estado de búsqueda */
.busqueda-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.busqueda-status.loading {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.busqueda-status.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.busqueda-status.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.busqueda-status i {
    font-size: 1.125rem;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Autocompletado de usuarios */
.autocomplete-wrapper {
    position: relative;
}

.sugerencias-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: -1px;
}

.sugerencia-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.sugerencia-item:last-child {
    border-bottom: none;
}

.sugerencia-item:hover {
    background: #f9fafb;
}

.sugerencia-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sugerencia-avatar i {
    font-size: 1.125rem;
    color: white;
}

.sugerencia-info {
    flex: 1;
    min-width: 0;
}

.sugerencia-nombre {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.125rem;
}

.sugerencia-detalle {
    font-size: 0.75rem;
    color: #6b7280;
}

.sugerencia-loading,
.sugerencia-empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.sugerencia-loading i {
    margin-right: 0.5rem;
}


/* === OPTIMIZACIONES DE RENDIMIENTO === */

/* Indicador de carga para scroll infinito */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    grid-column: 1 / -1;
}

.loading-more i {
    font-size: 1.25rem;
    color: #8b5cf6;
}

/* Animación de carga */
.tribu-grid .loading-more {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Botón cargar más (alternativa a scroll infinito) */
.btn-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 200px;
    margin: 1.5rem auto;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: 1 / -1;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* ========================================
   MODAL DE COMPARTIR CON QR
   ======================================== */

/* Modal de compartir */
.tribu-modal-compartir {
    max-width: 380px;
}

/* Sección del QR Preview */
.compartir-qr-section {
    background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.compartir-qr-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    background: white;
    border-radius: 16px;
    padding: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.compartir-qr-preview canvas {
    border-radius: 8px;
    display: block;
}

.compartir-qr-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.compartir-qr-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compartir-qr-titulo {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    max-width: 280px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compartir-qr-brand {
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b5cf6;
    margin-top: 0.125rem;
}

/* Opciones de compartir */
.compartir-opciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compartir-opcion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.compartir-opcion:hover {
    border-color: #8b5cf6;
    background: #faf5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.compartir-opcion:active {
    transform: translateY(0);
}

.compartir-opcion-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compartir-opcion-icon.qr-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.compartir-opcion-icon i {
    font-size: 1.375rem;
    color: white;
}

.compartir-opcion-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.compartir-opcion-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.compartir-opcion-desc {
    font-size: 0.8125rem;
    color: #6b7280;
}

.compartir-opcion-arrow {
    font-size: 1.25rem;
    color: #9ca3af;
    transition: transform 0.2s, color 0.2s;
}

.compartir-opcion:hover .compartir-opcion-arrow {
    color: #8b5cf6;
    transform: translateX(4px);
}

/* Toast centrado (si no existe ya) */
.toast-centrado {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}

.toast-centrado.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-centrado i {
    font-size: 1.375rem;
    flex-shrink: 0;
}

/* Responsive para modal de compartir */
@media (max-width: 480px) {
    .tribu-modal-compartir {
        max-width: 100%;
        margin: 0 0.75rem;
    }
    
    .compartir-qr-section {
        padding: 1.25rem;
    }
    
    .compartir-qr-preview {
        padding: 10px;
    }
    
    .compartir-qr-titulo {
        font-size: 1rem;
        max-width: 220px;
    }
    
    .compartir-opcion {
        padding: 0.875rem;
    }
    
    .compartir-opcion-icon {
        width: 40px;
        height: 40px;
    }
    
    .compartir-opcion-icon i {
        font-size: 1.25rem;
    }
    
    .compartir-opcion-title {
        font-size: 0.875rem;
    }
    
    .compartir-opcion-desc {
        font-size: 0.75rem;
    }
}


/* ========================================
   BLOQUEO DE SCROLL CUANDO HAY MODAL
   ======================================== */

/* Clase para bloquear scroll del body cuando hay modal abierto */
body.modal-open {
    overflow: hidden !important;
}

/* Para HTML también, necesario en algunos navegadores */
html.modal-open {
    overflow: hidden !important;
}


/* Botón Crear Galería - Más pequeño en Desktop */
@media (min-width: 769px) {
    .tribu-btn-crear {
        padding: 0.75rem 1.25rem;
        gap: 0.5rem;
        bottom: 90px; /* Justo encima del nav inferior */
        right: 2rem;
    }
    
    .tribu-btn-crear-icon {
        width: 32px;
        height: 32px;
    }
    
    .tribu-btn-crear-icon i {
        font-size: 1.25rem;
    }
    
    .tribu-btn-crear-title {
        font-size: 0.875rem;
    }
}
