/**
 * MY COLLECTIONS - Estilos para galerías personalizadas
 */

/* Modal principal */
.my-collections-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.my-collections-modal.active {
    opacity: 1;
    visibility: visible;
}

.my-collections-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.my-collections-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding-bottom: env(safe-area-inset-bottom);
}

.my-collections-modal.active .my-collections-content {
    transform: translateY(0);
}

/* Header */
.my-collections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.my-collections-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
    text-align: center;
}

.my-collections-back,
.my-collections-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-collections-back:hover,
.my-collections-close:hover {
    background: #e5e5e5;
    color: #333;
}

.my-collections-back i,
.my-collections-close i {
    font-size: 1.25rem;
}

/* Body */
.my-collections-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    max-height: 50vh;
}

/* Lista de colecciones */
.my-collections-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-collection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-collection-item:hover {
    background: #f0f1f3;
    transform: translateX(4px);
}

.my-collection-item.already-added {
    opacity: 0.7;
    cursor: default;
}

.my-collection-item.already-added:hover {
    transform: none;
}

.my-collection-cover {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.my-collection-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-collection-cover i {
    font-size: 1.5rem;
    color: #999;
}

.my-collection-info {
    flex: 1;
    min-width: 0;
}

.my-collection-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-collection-count {
    display: block;
    font-size: 0.8125rem;
    color: #666;
    margin-top: 2px;
}

.my-collection-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #8b5cf6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.my-collection-item.already-added .my-collection-action {
    background: #22c55e;
}

.my-collection-action i {
    font-size: 1rem;
}

/* Estado vacío */
.my-collections-empty {
    text-align: center;
    padding: 40px 20px;
}

.my-collections-empty i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 16px;
}

.my-collections-empty p {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.my-collections-empty span {
    font-size: 0.875rem;
    color: #666;
}

/* Footer */
.my-collections-footer {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
}

.my-collections-create-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-collections-create-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.my-collections-create-btn i {
    font-size: 1.25rem;
}

/* Formulario de creación */
.my-collections-form {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.my-collections-form-group {
    margin-bottom: 16px;
}

.my-collections-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.my-collections-form-group input[type="text"],
.my-collections-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1a1a1a;
    background: #fafafa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.my-collections-form-group input[type="text"]:focus,
.my-collections-form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.my-collections-form-group textarea {
    resize: none;
    min-height: 60px;
}

/* Opciones de privacidad - Compactas */
.my-collections-privacy-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.privacy-option {
    cursor: pointer;
    flex: 1;
    min-width: 90px;
}

.privacy-option input {
    display: none;
}

.privacy-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
}

.privacy-option input:checked + .privacy-option-content {
    background: #f5f3ff;
    border-color: #8b5cf6;
}

.privacy-option-content i {
    font-size: 1.25rem;
    color: #666;
}

.privacy-option input:checked + .privacy-option-content i {
    color: #8b5cf6;
}

.privacy-option-content div {
    width: 100%;
}

.privacy-option-content span {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.privacy-option-content small {
    display: block;
    font-size: 0.6875rem;
    color: #888;
    margin-top: 2px;
    line-height: 1.2;
}

/* Acciones del formulario */
.my-collections-form-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background: white;
}

.btn-create-collection {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-create-collection:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.btn-create-collection:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-create-collection i {
    font-size: 1.125rem;
}

/* Animación de rotación */
.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Desktop */
@media (min-width: 769px) {
    .my-collections-modal {
        align-items: center;
    }
    
    .my-collections-content {
        border-radius: 20px;
        max-height: 80vh;
        transform: translateY(20px) scale(0.95);
        opacity: 0;
        padding-bottom: 0;
    }
    
    .my-collections-modal.active .my-collections-content {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    
    .my-collections-form {
        max-height: calc(80vh - 120px);
    }
}


/* Toast breve para el lightbox */
.lightbox-mini-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    /* Evitar que afecte el layout */
    contain: layout style;
    will-change: opacity, transform;
}

.lightbox-mini-toast.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lightbox-mini-toast i {
    font-size: 1rem;
    flex-shrink: 0;
    animation: toastCheckBounce 0.4s ease-out;
}

.lightbox-mini-toast span {
    white-space: nowrap;
}

@keyframes toastCheckBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
