/* PHOTO TAGGING - Estilos del sistema de etiquetado */

.photo-tagging-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.photo-tagging-modal.active {
    display: flex;
}

.photo-tagging-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.photo-tagging-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-tagging-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.photo-tagging-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.photo-tagging-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.photo-tagging-close:hover {
    background: #f3f4f6;
}

.photo-tagging-close i {
    font-size: 1.5rem;
    color: #6b7280;
}

.photo-tagging-body {
    padding: 24px;
    overflow-y: auto;
}

.photo-tagging-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.photo-tagging-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.photo-tagging-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.photo-tagging-add-btn {
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.photo-tagging-add-btn:hover {
    background: #2563eb;
}

.photo-tagging-suggestions {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.photo-tagging-suggestion {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.photo-tagging-suggestion:hover {
    background: #f3f4f6;
}

.photo-tagging-suggestion i {
    font-size: 1.25rem;
    color: #6b7280;
}

.photo-tagging-suggestion span {
    flex: 1;
    font-size: 0.95rem;
    color: #111827;
}

.verified-badge {
    color: #10b981;
    font-size: 1.1rem;
}

.no-suggestions {
    padding: 12px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.photo-tagging-current-tags h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.photo-tagging-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.photo-tag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.photo-tag-item i.ri-user-line {
    font-size: 1.1rem;
    color: #6b7280;
}

.photo-tag-item span {
    flex: 1;
    font-size: 0.95rem;
    color: #111827;
}

.confirmed-icon {
    color: #10b981;
    font-size: 1.1rem;
}

.photo-tag-remove {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.photo-tag-remove:hover {
    background: #fee2e2;
}

.photo-tag-remove i {
    font-size: 1.1rem;
    color: #ef4444;
}

.no-tags,
.error-tags {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.error-tags {
    color: #ef4444;
}

/* Mobile */
@media (max-width: 768px) {
    .photo-tagging-content {
        width: 95%;
        max-height: 90vh;
    }

    .photo-tagging-header {
        padding: 16px 20px;
    }

    .photo-tagging-body {
        padding: 20px;
    }

    .photo-tagging-input-group {
        flex-direction: column;
    }

    .photo-tagging-add-btn {
        width: 100%;
        justify-content: center;
    }

    /* Ajuste cuando el teclado está abierto */
    .photo-tagging-modal.keyboard-open {
        align-items: flex-start;
        padding-top: 20px;
    }

    .photo-tagging-modal.keyboard-open .photo-tagging-content {
        max-height: 60vh;
        animation: modalSlideDown 0.3s ease;
    }

    @keyframes modalSlideDown {
        from {
            transform: translateY(-20px);
            opacity: 0.8;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Asegurar que las sugerencias sean visibles */
    .photo-tagging-modal.keyboard-open .photo-tagging-suggestions {
        max-height: 150px;
    }

    .photo-tagging-modal.keyboard-open .photo-tagging-body {
        padding-bottom: 10px;
    }
}

/* Success feedback - Toast moderno */
.tagging-success-feedback {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    pointer-events: none;
    animation: toastSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-size: 0.95rem;
    font-weight: 500;
}

.tagging-success-feedback i {
    font-size: 1.3rem;
    color: #10b981;
}

.tagging-success-feedback.hide {
    animation: toastSlideDown 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastSlideUp {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideDown {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tagging-success-feedback {
        bottom: 80px;
        left: 16px;
        right: 16px;
        transform: translateY(100px);
    }

    @keyframes toastSlideUp {
        0% {
            transform: translateY(100px);
            opacity: 0;
        }
        100% {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes toastSlideDown {
        0% {
            transform: translateY(0);
            opacity: 1;
        }
        100% {
            transform: translateY(100px);
            opacity: 0;
        }
    }
}
